Aggregation step.
Expands features array if needed by a factor of 2. Allocates a new feature, increment feature counter and encode geometry and properties into it.
Definition at line 1187 of file mvt.c.
1189 bool isnull =
false;
1193 VectorTile__Tile__Feature *feature;
1194 VectorTile__Tile__Layer *layer = ctx->
layer;
1196 POSTGIS_DEBUG(2,
"mvt_agg_transfn called");
1201 layer->features = repalloc(layer->features, new_capacity *
1202 sizeof(*layer->features));
1204 POSTGIS_DEBUGF(3,
"mvt_agg_transfn new_capacity: %zd", new_capacity);
1210 datum = GetAttributeByNum(ctx->
row, ctx->
geom_index + 1, &isnull);
1211 POSTGIS_DEBUGF(3,
"mvt_agg_transfn ctx->geom_index: %d", ctx->
geom_index);
1212 POSTGIS_DEBUGF(3,
"mvt_agg_transfn isnull: %u", isnull);
1213 POSTGIS_DEBUGF(3,
"mvt_agg_transfn datum: %lu", datum);
1216 POSTGIS_DEBUG(3,
"mvt_agg_transfn got null geom");
1220 feature = palloc(
sizeof(*feature));
1221 vector_tile__tile__feature__init(feature);
1228 POSTGIS_DEBUGF(3,
"mvt_agg_transfn encoded feature count: %zd", layer->n_features);
1229 layer->features[layer->n_features++] = feature;
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
static void encode_geometry(mvt_agg_context *ctx, LWGEOM *lwgeom)
static void parse_column_keys(mvt_agg_context *ctx)
static void parse_values(mvt_agg_context *ctx)
VectorTile__Tile__Layer * layer
VectorTile__Tile__Feature * feature
References encode_geometry(), mvt_agg_context::feature, mvt_agg_context::features_capacity, mvt_agg_context::geom_index, mvt_agg_context::layer, lwgeom_free(), lwgeom_from_gserialized(), parse_column_keys(), parse_values(), mvt_agg_context::row, and UINT32_MAX.
Referenced by pgis_asmvt_transfn().