558 POSTGIS_DEBUG(2,
"parse_values called");
560 uint32_t *tags = palloc(n_keys * 2 *
sizeof(*tags));
564 int natts = tupdesc->natts;
567 POSTGIS_DEBUGF(3,
"parse_values natts: %d", natts);
569 for (i = 0; i < natts; i++) {
577 #if POSTGIS_PGSQL_VERSION < 110 578 key = tupdesc->attrs[i]->attname.data;
579 typoid = getBaseType(tupdesc->attrs[i]->atttypid);
581 key = tupdesc->attrs[i].attname.data;
582 typoid = getBaseType(tupdesc->attrs[i].atttypid);
584 datum = GetAttributeByNum(ctx->
row, i+1, &isnull);
587 POSTGIS_DEBUG(3,
"parse_values isnull detected");
590 #if POSTGIS_PGSQL_VERSION >= 94 591 if (k == -1 && typoid != JSONBOID)
592 elog(ERROR,
"parse_values: unexpectedly could not find parsed key name '%s'", key);
593 if (typoid == JSONBOID) {
599 elog(ERROR,
"parse_values: unexpectedly could not find parsed key name '%s'", key);
605 bool_values_hash, bool_value,
606 DatumGetBool,
sizeof(protobuf_c_boolean));
619 float_values_hash, float_value,
620 DatumGetFloat4,
sizeof(
float));
624 double_values_hash, double_value,
625 DatumGetFloat8,
sizeof(
double));
634 ReleaseTupleDesc(tupdesc);
639 POSTGIS_DEBUGF(3,
"parse_values n_tags %zd", ctx->
feature->n_tags);
static TupleDesc get_tuple_desc(struct mvt_agg_context *ctx)
static uint32_t * parse_jsonb(struct mvt_agg_context *ctx, Jsonb *jb, uint32_t *tags)
static void parse_datum_as_string(struct mvt_agg_context *ctx, Oid typoid, Datum datum, uint32_t *tags, uint32_t k)
static uint32_t get_key_index(struct mvt_agg_context *ctx, char *name)
VectorTile__Tile__Feature * feature
#define MVT_PARSE_DATUM(type, kvtype, hash, valuefield, datumfunc, size)
#define MVT_PARSE_INT_DATUM(type, datumfunc)