PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ mvt_agg_init_context()

void mvt_agg_init_context ( mvt_agg_context ctx)

Initialize aggregation context.

Definition at line 799 of file mvt.c.

References mvt_agg_context::bool_values_hash, mvt_agg_context::double_values_hash, mvt_agg_context::extent, mvt_agg_context::features_capacity, FEATURES_CAPACITY_INITIAL, mvt_agg_context::float_values_hash, mvt_agg_context::keys_hash, mvt_agg_context::keys_hash_i, mvt_agg_context::layer, mvt_agg_context::name, mvt_agg_context::sint_values_hash, mvt_agg_context::string_values_hash, mvt_agg_context::tile, mvt_agg_context::uint_values_hash, and mvt_agg_context::values_hash_i.

Referenced by pgis_asmvt_transfn().

800 {
801  VectorTile__Tile__Layer *layer;
802 
803  POSTGIS_DEBUG(2, "mvt_agg_init_context called");
804 
805  if (ctx->extent == 0)
806  elog(ERROR, "mvt_agg_init_context: extent cannot be 0");
807 
808  ctx->tile = NULL;
810  ctx->keys_hash = NULL;
811  ctx->string_values_hash = NULL;
812  ctx->float_values_hash = NULL;
813  ctx->double_values_hash = NULL;
814  ctx->uint_values_hash = NULL;
815  ctx->sint_values_hash = NULL;
816  ctx->bool_values_hash = NULL;
817  ctx->values_hash_i = 0;
818  ctx->keys_hash_i = 0;
819 
820  layer = palloc(sizeof(*layer));
821  vector_tile__tile__layer__init(layer);
822  layer->version = 2;
823  layer->name = ctx->name;
824  layer->has_extent = 1;
825  layer->extent = ctx->extent;
826  layer->features = palloc (ctx->features_capacity *
827  sizeof(*layer->features));
828 
829  ctx->layer = layer;
830 }
struct mvt_kv_double_value * double_values_hash
Definition: mvt.h:62
struct mvt_kv_string_value * string_values_hash
Definition: mvt.h:60
char * name
Definition: mvt.h:50
VectorTile__Tile * tile
Definition: mvt.h:57
struct mvt_kv_float_value * float_values_hash
Definition: mvt.h:61
VectorTile__Tile__Layer * layer
Definition: mvt.h:56
uint32_t keys_hash_i
Definition: mvt.h:67
size_t features_capacity
Definition: mvt.h:58
struct mvt_kv_uint_value * uint_values_hash
Definition: mvt.h:63
struct mvt_kv_bool_value * bool_values_hash
Definition: mvt.h:65
uint32_t values_hash_i
Definition: mvt.h:66
#define FEATURES_CAPACITY_INITIAL
Definition: mvt.c:40
uint32_t extent
Definition: mvt.h:51
struct mvt_kv_key * keys_hash
Definition: mvt.h:59
struct mvt_kv_sint_value * sint_values_hash
Definition: mvt.h:64
Here is the caller graph for this function: