PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ mvt_agg_init_context()

void mvt_agg_init_context ( mvt_agg_context ctx)

Initialize aggregation context.

Definition at line 1197 of file mvt.c.

1198 {
1199  VectorTile__Tile__Layer *layer;
1200 
1201  POSTGIS_DEBUG(2, "mvt_agg_init_context called");
1202 
1203  if (ctx->extent == 0)
1204  elog(ERROR, "mvt_agg_init_context: extent cannot be 0");
1205 
1206  ctx->tile = NULL;
1208  ctx->keys_hash = NULL;
1209  ctx->string_values_hash = NULL;
1210  ctx->float_values_hash = NULL;
1211  ctx->double_values_hash = NULL;
1212  ctx->uint_values_hash = NULL;
1213  ctx->sint_values_hash = NULL;
1214  ctx->bool_values_hash = NULL;
1215  ctx->values_hash_i = 0;
1216  ctx->keys_hash_i = 0;
1217  ctx->id_index = UINT32_MAX;
1218  ctx->geom_index = UINT32_MAX;
1219 
1220  memset(&ctx->column_cache, 0, sizeof(ctx->column_cache));
1221 
1222  layer = palloc(sizeof(*layer));
1223  vector_tile__tile__layer__init(layer);
1224  layer->version = 2;
1225  layer->name = ctx->name;
1226  layer->extent = ctx->extent;
1227  layer->features = palloc(ctx->features_capacity * sizeof(*layer->features));
1228 
1229  ctx->layer = layer;
1230 }
#define UINT32_MAX
Definition: lwin_wkt_lex.c:343
#define FEATURES_CAPACITY_INITIAL
Definition: mvt.c:50
uint32_t geom_index
Definition: mvt.h:72
uint32_t values_hash_i
Definition: mvt.h:92
struct mvt_kv_value * uint_values_hash
Definition: mvt.h:87
size_t features_capacity
Definition: mvt.h:78
VectorTile__Tile__Layer * layer
Definition: mvt.h:76
uint32_t keys_hash_i
Definition: mvt.h:94
struct mvt_kv_key * keys_hash
Definition: mvt.h:81
struct mvt_kv_value * float_values_hash
Definition: mvt.h:85
VectorTile__Tile * tile
Definition: mvt.h:77
struct mvt_kv_value * bool_values_hash
Definition: mvt.h:89
struct mvt_kv_value * string_values_hash
Definition: mvt.h:84
uint32_t extent
Definition: mvt.h:64
struct mvt_kv_value * double_values_hash
Definition: mvt.h:86
uint32_t id_index
Definition: mvt.h:68
mvt_column_cache column_cache
Definition: mvt.h:97
struct mvt_kv_value * sint_values_hash
Definition: mvt.h:88
char * name
Definition: mvt.h:63

References mvt_agg_context::bool_values_hash, mvt_agg_context::column_cache, 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::geom_index, mvt_agg_context::id_index, 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, UINT32_MAX, mvt_agg_context::uint_values_hash, and mvt_agg_context::values_hash_i.

Referenced by pgis_asmvt_transfn().

Here is the caller graph for this function: