PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ encode_values()

static void encode_values ( mvt_agg_context ctx)
static

Definition at line 427 of file mvt.c.

428 {
429  VectorTile__Tile__Value **values;
430  struct mvt_kv_string_value *kv;
431 
432  POSTGIS_DEBUG(2, "encode_values called");
433 
434  values = palloc(ctx->values_hash_i * sizeof(*values));
435  for (kv = ctx->string_values_hash; kv != NULL; kv=kv->hh.next)
436  {
437  VectorTile__Tile__Value *value = create_value();
438  value->string_value = kv->string_value;
439  values[kv->id] = value;
440  }
442  float_values_hash, has_float_value, float_value);
444  double_values_hash, has_double_value, double_value);
446  uint_values_hash, has_uint_value, uint_value);
448  sint_values_hash, has_sint_value, sint_value);
450  bool_values_hash, has_bool_value, bool_value);
451 
452  POSTGIS_DEBUGF(3, "encode_values n_values: %d", ctx->values_hash_i);
453  ctx->layer->n_values = ctx->values_hash_i;
454  ctx->layer->values = values;
455 
456  HASH_CLEAR(hh, ctx->string_values_hash);
457  HASH_CLEAR(hh, ctx->float_values_hash);
458  HASH_CLEAR(hh, ctx->double_values_hash);
459  HASH_CLEAR(hh, ctx->uint_values_hash);
460  HASH_CLEAR(hh, ctx->sint_values_hash);
461  HASH_CLEAR(hh, ctx->bool_values_hash);
462 
463  pfree(ctx->column_cache.column_keys_index);
464  pfree(ctx->column_cache.column_oid);
465  pfree(ctx->column_cache.values);
466  pfree(ctx->column_cache.nulls);
467  ReleaseTupleDesc(ctx->column_cache.tupdesc);
468  memset(&ctx->column_cache, 0, sizeof(ctx->column_cache));
469 
470 }
static VectorTile__Tile__Value * create_value()
Definition: mvt.c:405
#define MVT_CREATE_VALUES(kvtype, hash, hasfield, valuefield)
Definition: mvt.c:412
int value
Definition: genraster.py:62
struct mvt_kv_string_value * string_values_hash
Definition: mvt.h:71
struct mvt_kv_bool_value * bool_values_hash
Definition: mvt.h:76
struct mvt_kv_uint_value * uint_values_hash
Definition: mvt.h:74
uint32_t values_hash_i
Definition: mvt.h:77
VectorTile__Tile__Layer * layer
Definition: mvt.h:67
struct mvt_kv_float_value * float_values_hash
Definition: mvt.h:72
struct mvt_kv_sint_value * sint_values_hash
Definition: mvt.h:75
struct mvt_kv_double_value * double_values_hash
Definition: mvt.h:73
mvt_column_cache column_cache
Definition: mvt.h:80
bool * nulls
Definition: mvt.h:53
TupleDesc tupdesc
Definition: mvt.h:54
uint32_t * column_keys_index
Definition: mvt.h:50
Datum * values
Definition: mvt.h:52
uint32_t * column_oid
Definition: mvt.h:51
uint32_t id
Definition: mvt.c:73
char * string_value
Definition: mvt.c:72
UT_hash_handle hh
Definition: mvt.c:74

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, mvt_kv_string_value::hh, mvt_kv_string_value::id, mvt_agg_context::layer, MVT_CREATE_VALUES, 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: