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 888 of file mvt.c.
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().
894 VectorTile__Tile__Feature *feature;
895 VectorTile__Tile__Layer *layer = ctx->
layer;
896 POSTGIS_DEBUG(2,
"mvt_agg_transfn called");
900 layer->features = repalloc(layer->features, new_capacity *
901 sizeof(*layer->features));
903 POSTGIS_DEBUGF(3,
"mvt_agg_transfn new_capacity: %zd", new_capacity);
909 datum = GetAttributeByNum(ctx->
row, ctx->
geom_index + 1, &isnull);
910 POSTGIS_DEBUGF(3,
"mvt_agg_transfn ctx->geom_index: %d", ctx->
geom_index);
911 POSTGIS_DEBUGF(3,
"mvt_agg_transfn isnull: %u", isnull);
912 POSTGIS_DEBUGF(3,
"mvt_agg_transfn datum: %lu", datum);
915 POSTGIS_DEBUG(3,
"mvt_agg_transfn got null geom");
919 feature = palloc(
sizeof(*feature));
920 vector_tile__tile__feature__init(feature);
927 POSTGIS_DEBUGF(3,
"mvt_agg_transfn encoded feature count: %zd", layer->n_features);
928 layer->features[layer->n_features++] = feature;
static void parse_values(struct mvt_agg_context *ctx)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
static void parse_column_keys(struct mvt_agg_context *ctx)
VectorTile__Tile__Layer * layer
static void encode_geometry(struct mvt_agg_context *ctx, LWGEOM *lwgeom)
VectorTile__Tile__Feature * feature