PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ encode_keys()

static void encode_keys ( mvt_agg_context ctx)
static

Definition at line 347 of file mvt.c.

References HASH_CLEAR, mvt_kv_key::hh, mvt_kv_key::id, mvt_agg_context::keys_hash, mvt_agg_context::keys_hash_i, mvt_agg_context::layer, mvt_kv_key::name, and UT_hash_handle::next.

Referenced by mvt_ctx_to_tile().

348 {
349  struct mvt_kv_key *kv;
350  size_t n_keys = ctx->keys_hash_i;
351  char **keys = palloc(n_keys * sizeof(*keys));
352  for (kv = ctx->keys_hash; kv != NULL; kv=kv->hh.next)
353  keys[kv->id] = kv->name;
354  ctx->layer->n_keys = n_keys;
355  ctx->layer->keys = keys;
356 
357  HASH_CLEAR(hh, ctx->keys_hash);
358 }
uint32_t id
Definition: mvt.c:56
void * next
Definition: uthash.h:1085
VectorTile__Tile__Layer * layer
Definition: mvt.h:56
uint32_t keys_hash_i
Definition: mvt.h:67
Definition: mvt.c:54
#define HASH_CLEAR(hh, head)
Definition: uthash.h:993
struct mvt_kv_key * keys_hash
Definition: mvt.h:59
UT_hash_handle hh
Definition: mvt.c:57
char * name
Definition: mvt.c:55
Here is the caller graph for this function: