PostGIS 3.7.0dev-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 540 of file geobuf.c.

541{
542 Data *data;
543 Data__FeatureCollection *fc;
544
545 ctx->has_dimensions = 0;
546 ctx->dimensions = 2;
547 ctx->has_precision = 0;
549 ctx->e = 1;
551
552 data = palloc(sizeof(*data));
553 data__init(data);
554
555 fc = palloc(sizeof(*fc));
556 data__feature_collection__init(fc);
557
558 fc->features = palloc (ctx->features_capacity *
559 sizeof(*fc->features));
560
561 ctx->lwgeoms = palloc (ctx->features_capacity *
562 sizeof(*ctx->lwgeoms));
563
564 data->data_type_case = DATA__DATA_TYPE_FEATURE_COLLECTION;
565 data->feature_collection = fc;
566
567 ctx->data = data;
568}
#define MAX_PRECISION
Definition geobuf.c:31
#define FEATURES_CAPACITY_INITIAL
Definition geobuf.c:30
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: