PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ encode_keys()

static void encode_keys ( mvt_agg_context ctx)
static

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

379 {
380  struct mvt_kv_key *kv;
381  size_t n_keys = ctx->keys_hash_i;
382  char **keys = palloc(n_keys * sizeof(*keys));
383  for (kv = ctx->keys_hash; kv != NULL; kv=kv->hh.next)
384  keys[kv->id] = kv->name;
385  ctx->layer->n_keys = n_keys;
386  ctx->layer->keys = keys;
387 
388  HASH_CLEAR(hh, ctx->keys_hash);
389 }
uint32_t id
Definition: mvt.c:59
void * next
Definition: uthash.h:1085
VectorTile__Tile__Layer * layer
Definition: mvt.h:66
uint32_t keys_hash_i
Definition: mvt.h:77
Definition: mvt.c:56
#define HASH_CLEAR(hh, head)
Definition: uthash.h:993
struct mvt_kv_key * keys_hash
Definition: mvt.h:69
UT_hash_handle hh
Definition: mvt.c:60
char * name
Definition: mvt.c:58
Here is the caller graph for this function: