PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ encode_values()

static void encode_values ( mvt_agg_context ctx)
static

Definition at line 413 of file mvt.c.

References mvt_agg_context::bool_values_hash, mvt_agg_context::column_cache, mvt_column_cache::column_keys_index, mvt_column_cache::column_oid, create_value(), mvt_agg_context::double_values_hash, mvt_agg_context::float_values_hash, HASH_CLEAR, mvt_kv_key::hh, mvt_kv_string_value::hh, mvt_kv_string_value::id, mvt_agg_context::layer, MVT_CREATE_VALUES, UT_hash_handle::next, mvt_column_cache::nulls, mvt_agg_context::sint_values_hash, mvt_kv_string_value::string_value, mvt_agg_context::string_values_hash, mvt_column_cache::tupdesc, mvt_agg_context::uint_values_hash, genraster::value, mvt_column_cache::values, and mvt_agg_context::values_hash_i.

Referenced by mvt_ctx_to_tile().

414 {
415  VectorTile__Tile__Value **values;
416  struct mvt_kv_string_value *kv;
417 
418  POSTGIS_DEBUG(2, "encode_values called");
419 
420  values = palloc(ctx->values_hash_i * sizeof(*values));
421  for (kv = ctx->string_values_hash; kv != NULL; kv=kv->hh.next)
422  {
423  VectorTile__Tile__Value *value = create_value();
424  value->string_value = kv->string_value;
425  values[kv->id] = value;
426  }
428  float_values_hash, has_float_value, float_value);
430  double_values_hash, has_double_value, double_value);
432  uint_values_hash, has_uint_value, uint_value);
434  sint_values_hash, has_sint_value, sint_value);
436  bool_values_hash, has_bool_value, bool_value);
437 
438  POSTGIS_DEBUGF(3, "encode_values n_values: %d", ctx->values_hash_i);
439  ctx->layer->n_values = ctx->values_hash_i;
440  ctx->layer->values = values;
441 
448 
449  pfree(ctx->column_cache.column_keys_index);
450  pfree(ctx->column_cache.column_oid);
451  pfree(ctx->column_cache.values);
452  pfree(ctx->column_cache.nulls);
453  ReleaseTupleDesc(ctx->column_cache.tupdesc);
454  memset(&ctx->column_cache, 0, sizeof(ctx->column_cache));
455 
456 }
struct mvt_kv_double_value * double_values_hash
Definition: mvt.h:72
struct mvt_kv_string_value * string_values_hash
Definition: mvt.h:70
mvt_column_cache column_cache
Definition: mvt.h:79
char * string_value
Definition: mvt.c:65
uint32_t id
Definition: mvt.c:66
struct mvt_kv_float_value * float_values_hash
Definition: mvt.h:71
bool * nulls
Definition: mvt.h:54
void * next
Definition: uthash.h:1085
VectorTile__Tile__Layer * layer
Definition: mvt.h:66
struct mvt_kv_uint_value * uint_values_hash
Definition: mvt.h:73
uint32_t * column_keys_index
Definition: mvt.h:51
struct mvt_kv_bool_value * bool_values_hash
Definition: mvt.h:75
Datum * values
Definition: mvt.h:53
uint32_t values_hash_i
Definition: mvt.h:76
#define HASH_CLEAR(hh, head)
Definition: uthash.h:993
struct mvt_kv_sint_value * sint_values_hash
Definition: mvt.h:74
static VectorTile__Tile__Value * create_value()
Definition: mvt.c:391
UT_hash_handle hh
Definition: mvt.c:67
int value
Definition: genraster.py:61
uint32_t * column_oid
Definition: mvt.h:52
TupleDesc tupdesc
Definition: mvt.h:55
#define MVT_CREATE_VALUES(kvtype, hash, hasfield, valuefield)
Definition: mvt.c:398
Here is the call graph for this function:
Here is the caller graph for this function: