PostGIS  3.4.0dev-r@@SVN_REVISION@@
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages

◆ add_value_as_string_with_size()

static bool add_value_as_string_with_size ( mvt_agg_context ctx,
struct feature_builder feature,
char *  value,
size_t  size,
uint32_t  k 
)
static

Definition at line 508 of file mvt.c.

509 {
510  bool kept = false;
511  struct mvt_kv_value *kv;
512  unsigned hashv;
513  HASH_VALUE(value, size, hashv);
514  POSTGIS_DEBUG(2, "add_value_as_string called");
515  HASH_FIND_BYHASHVALUE(hh, ctx->string_values_hash, value, size, hashv, kv);
516  if (!kv)
517  {
518  POSTGIS_DEBUG(4, "add_value_as_string value not found");
519  kv = palloc(sizeof(*kv));
520  POSTGIS_DEBUGF(4, "add_value_as_string new hash key: %d",
521  ctx->values_hash_i);
522  kv->id = ctx->values_hash_i++;
523  vector_tile__tile__value__init(kv->value);
524  kv->value->string_value = value;
525  kv->value->test_oneof_case = VECTOR_TILE__TILE__VALUE__TEST_ONEOF_STRING_VALUE;
526  HASH_ADD_KEYPTR_BYHASHVALUE(hh, ctx->string_values_hash, kv->value->string_value, size, hashv, kv);
527  kept = true;
528  }
529 
530  feature_add_property(feature, k, kv->id);
531  return kept;
532 }
static void feature_add_property(struct feature_builder *builder, uint32_t key_id, uint32_t value_id)
Definition: mvt.c:124
int value
Definition: genraster.py:62
uint32_t values_hash_i
Definition: mvt.h:94
struct mvt_kv_value * string_values_hash
Definition: mvt.h:86
VectorTile__Tile__Value value[1]
Definition: mvt.c:71
UT_hash_handle hh
Definition: mvt.c:73
uint32_t id
Definition: mvt.c:72

References feature_add_property(), mvt_kv_value::hh, mvt_kv_value::id, mvt_agg_context::string_values_hash, mvt_kv_value::value, genraster::value, and mvt_agg_context::values_hash_i.

Referenced by add_value_as_string().

Here is the call graph for this function:
Here is the caller graph for this function: