PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ geobuf_agg_init_context()

void geobuf_agg_init_context ( struct geobuf_agg_context ctx)

Initialize aggregation context.

Definition at line 524 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().

525 {
526  Data *data;
527  Data__FeatureCollection *fc;
528 
529  ctx->has_dimensions = 0;
530  ctx->dimensions = 2;
531  ctx->has_precision = 0;
532  ctx->precision = MAX_PRECISION;
533  ctx->e = 1;
535 
536  data = palloc(sizeof(*data));
537  data__init(data);
538 
539  fc = palloc(sizeof(*fc));
540  data__feature_collection__init(fc);
541 
542  fc->features = palloc (ctx->features_capacity *
543  sizeof(*fc->features));
544 
545  ctx->lwgeoms = palloc (ctx->features_capacity *
546  sizeof(*ctx->lwgeoms));
547 
548  data->data_type_case = DATA__DATA_TYPE_FEATURE_COLLECTION;
549  data->feature_collection = fc;
550 
551  ctx->data = data;
552 }
protobuf_c_boolean has_precision
Definition: geobuf.h:58
protobuf_c_boolean has_dimensions
Definition: geobuf.h:60
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: