Aggregation step.
Expands features array if needed by a factor of 2. Allocates a new feature, increment feature counter and encode properties into it.
Definition at line 561 of file geobuf.c.
References analyze_geometry(), analyze_geometry_flags(), geobuf_agg_context::data, encode_feature(), encode_keys(), geobuf_agg_context::features_capacity, geobuf_agg_context::geom_index, lwgeom_from_gserialized(), geobuf_agg_context::lwgeoms, and geobuf_agg_context::row.
Referenced by pgis_asgeobuf_transfn().
566 Data__FeatureCollection *fc = ctx->
data->feature_collection;
567 Data__Feature *feature;
571 fc->features = repalloc(fc->features, new_capacity *
572 sizeof(*fc->features));
579 if (fc->n_features == 0)
582 datum = GetAttributeByNum(ctx->
row, ctx->
geom_index + 1, &isnull);
592 if (fc->n_features == 0)
597 ctx->
lwgeoms[fc->n_features] = lwgeom;
598 fc->features[fc->n_features++] = feature;
static void analyze_geometry_flags(struct geobuf_agg_context *ctx, LWGEOM *lwgeom)
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
static void encode_keys(struct geobuf_agg_context *ctx)
static Data__Feature * encode_feature(struct geobuf_agg_context *ctx)
static void analyze_geometry(struct geobuf_agg_context *ctx, LWGEOM *lwgeom)