PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ add_value_as_string()

static void add_value_as_string ( mvt_agg_context ctx,
char *  value,
uint32_t tags,
uint32_t  k 
)
static

Definition at line 464 of file mvt.c.

References mvt_agg_context::c, HASH_ADD_KEYPTR, HASH_FIND, mvt_kv_key::hh, mvt_kv_string_value::id, mvt_kv_string_value::string_value, mvt_agg_context::string_values_hash, genraster::value, and mvt_agg_context::values_hash_i.

Referenced by parse_datum_as_string(), and parse_jsonb().

466 {
467  struct mvt_kv_string_value *kv;
468  size_t size = strlen(value);
469  POSTGIS_DEBUG(2, "add_value_as_string called");
470  HASH_FIND(hh, ctx->string_values_hash, value, size, kv);
471  if (!kv) {
472  POSTGIS_DEBUG(4, "add_value_as_string value not found");
473  kv = palloc(sizeof(*kv));
474  POSTGIS_DEBUGF(4, "add_value_as_string new hash key: %d",
475  ctx->values_hash_i);
476  kv->id = ctx->values_hash_i++;
477  kv->string_value = value;
479  size, kv);
480  }
481  tags[ctx->c*2] = k;
482  tags[ctx->c*2+1] = kv->id;
483 }
#define HASH_ADD_KEYPTR(hh, head, keyptr, keylen_in, add)
Definition: uthash.h:329
uint32_t c
Definition: mvt.h:68
struct mvt_kv_string_value * string_values_hash
Definition: mvt.h:60
char * string_value
Definition: mvt.c:61
uint32_t id
Definition: mvt.c:62
#define HASH_FIND(hh, head, keyptr, keylen, out)
Definition: uthash.h:132
uint32_t values_hash_i
Definition: mvt.h:66
UT_hash_handle hh
Definition: mvt.c:63
int value
Definition: genraster.py:61
Here is the caller graph for this function: