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.
1278{
1279 bool isnull = false;
1280 Datum datum;
1283 VectorTile__Tile__Feature *feature;
1284 VectorTile__Tile__Layer *layer = ctx->
layer;
1285
1286 POSTGIS_DEBUG(2, "mvt_agg_transfn called");
1287
1289 {
1291 layer->features = repalloc(layer->features, new_capacity *
1292 sizeof(*layer->features));
1294 POSTGIS_DEBUGF(3, "mvt_agg_transfn new_capacity: %zd", new_capacity);
1295 }
1296
1299
1300 datum = GetAttributeByNum(ctx->
row, ctx->
geom_index + 1, &isnull);
1301 POSTGIS_DEBUGF(3,
"mvt_agg_transfn ctx->geom_index: %d", ctx->
geom_index);
1302 POSTGIS_DEBUGF(3, "mvt_agg_transfn isnull: %u", isnull);
1303 POSTGIS_DEBUGF(3, "mvt_agg_transfn datum: %lu", datum);
1304 if (isnull)
1305 {
1306 POSTGIS_DEBUG(3, "mvt_agg_transfn got null geom");
1307 return;
1308 }
1309
1310 feature = palloc(sizeof(*feature));
1311 vector_tile__tile__feature__init(feature);
1312
1314
1317
1318 POSTGIS_DEBUGF(3, "mvt_agg_transfn encoded feature count: %zd", layer->n_features);
1319 layer->features[layer->n_features++] = feature;
1320
1323
1325}
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