PostGIS  2.5.0dev-r@@SVN_REVISION@@
void geobuf_agg_init_context ( struct geobuf_agg_context ctx)

Initialize aggregation context.

Definition at line 523 of file geobuf.c.

References geobuf_agg_context::data, ovdump::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().

524 {
525  Data *data;
526  Data__FeatureCollection *fc;
527 
528  ctx->has_dimensions = 0;
529  ctx->dimensions = 2;
530  ctx->has_precision = 0;
531  ctx->precision = MAX_PRECISION;
532  ctx->e = 1;
534 
535  data = palloc(sizeof(*data));
536  data__init(data);
537 
538  fc = palloc(sizeof(*fc));
539  data__feature_collection__init(fc);
540 
541  fc->features = palloc (ctx->features_capacity *
542  sizeof(*fc->features));
543 
544  ctx->lwgeoms = palloc (ctx->features_capacity *
545  sizeof(*ctx->lwgeoms));
546 
547  data->data_type_case = DATA__DATA_TYPE_FEATURE_COLLECTION;
548  data->feature_collection = fc;
549 
550  ctx->data = data;
551 }
protobuf_c_boolean has_precision
Definition: geobuf.h:58
protobuf_c_boolean has_dimensions
Definition: geobuf.h:60
tuple data
Definition: ovdump.py:103
#define FEATURES_CAPACITY_INITIAL
Definition: geobuf.c:30
#define MAX_PRECISION
Definition: geobuf.c:31
uint32_t dimensions
Definition: geobuf.h:61
uint32_t precision
Definition: geobuf.h:59
size_t features_capacity
Definition: geobuf.h:56
LWGEOM ** lwgeoms
Definition: geobuf.h:53
uint32_t e
Definition: geobuf.h:57

Here is the caller graph for this function: