PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ add_value_as_string()

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

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

459 {
460  struct mvt_kv_string_value *kv;
461  size_t size = strlen(value);
462  POSTGIS_DEBUG(2, "add_value_as_string called");
463  HASH_FIND(hh, ctx->string_values_hash, value, size, kv);
464  if (!kv) {
465  POSTGIS_DEBUG(4, "add_value_as_string value not found");
466  kv = palloc(sizeof(*kv));
467  POSTGIS_DEBUGF(4, "add_value_as_string new hash key: %d",
468  ctx->values_hash_i);
469  kv->id = ctx->values_hash_i++;
470  kv->string_value = value;
472  size, kv);
473  }
474  tags[ctx->c*2] = k;
475  tags[ctx->c*2+1] = kv->id;
476 }
#define HASH_ADD_KEYPTR(hh, head, keyptr, keylen_in, add)
Definition: uthash.h:329
uint32_t c
Definition: mvt.h:67
struct mvt_kv_string_value * string_values_hash
Definition: mvt.h:59
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:65
UT_hash_handle hh
Definition: mvt.c:63
int value
Definition: genraster.py:61
Here is the caller graph for this function: