PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ geobuf_agg_init_context()

void geobuf_agg_init_context ( struct geobuf_agg_context ctx)

Initialize aggregation context.

Definition at line 541 of file geobuf.c.

542{
543 Data *data;
544 Data__FeatureCollection *fc;
545
546 ctx->has_dimensions = 0;
547 ctx->dimensions = 2;
548 ctx->has_precision = 0;
550 ctx->e = 1;
552
553 data = palloc(sizeof(*data));
554 data__init(data);
555
556 fc = palloc(sizeof(*fc));
557 data__feature_collection__init(fc);
558
559 fc->features = palloc (ctx->features_capacity *
560 sizeof(*fc->features));
561
562 ctx->lwgeoms = palloc (ctx->features_capacity *
563 sizeof(*ctx->lwgeoms));
564
565 data->data_type_case = DATA__DATA_TYPE_FEATURE_COLLECTION;
566 data->feature_collection = fc;
567
568 ctx->data = data;
569}
#define MAX_PRECISION
Definition geobuf.c:32
#define FEATURES_CAPACITY_INITIAL
Definition geobuf.c:31
uint32_t precision
Definition geobuf.h:59
protobuf_c_boolean has_precision
Definition geobuf.h:58
protobuf_c_boolean has_dimensions
Definition geobuf.h:60
size_t features_capacity
Definition geobuf.h:56
LWGEOM ** lwgeoms
Definition geobuf.h:53
uint32_t dimensions
Definition geobuf.h:61

References geobuf_agg_context::data, geobuf_agg_context::dimensions, geobuf_agg_context::e, geobuf_agg_context::features_capacity, FEATURES_CAPACITY_INITIAL, geobuf_agg_context::has_dimensions, geobuf_agg_context::has_precision, geobuf_agg_context::lwgeoms, MAX_PRECISION, and geobuf_agg_context::precision.

Referenced by pgis_asgeobuf_transfn().

Here is the caller graph for this function: