PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ encode_values()

static void encode_values ( mvt_agg_context ctx)
static

Definition at line 414 of file mvt.c.

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

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_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().

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