PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ set_feature_id()

static void set_feature_id ( mvt_agg_context ctx,
Datum  datum,
bool  isNull 
)
static

Sets the feature id.

Ignores Nulls and negative values

Definition at line 594 of file mvt.c.

595 {
596  Oid typoid = ctx->column_cache.column_oid[ctx->id_index];
597  int64_t value = INT64_MIN;
598 
599  if (isNull)
600  {
601  POSTGIS_DEBUG(3, "set_feature_id: Ignored null value");
602  return;
603  }
604 
605  switch (typoid)
606  {
607  case INT2OID:
608  value = DatumGetInt16(datum);
609  break;
610  case INT4OID:
611  value = DatumGetInt32(datum);
612  break;
613  case INT8OID:
614  value = DatumGetInt64(datum);
615  break;
616  default:
617  elog(ERROR, "set_feature_id: Feature id type does not match");
618  }
619 
620  if (value < 0)
621  {
622  POSTGIS_DEBUG(3, "set_feature_id: Ignored negative value");
623  return;
624  }
625 
626  ctx->feature->has_id = true;
627  ctx->feature->id = (uint64_t) value;
628 }
int value
Definition: genraster.py:62
VectorTile__Tile__Feature * feature
Definition: mvt.h:75
uint32_t id_index
Definition: mvt.h:68
mvt_column_cache column_cache
Definition: mvt.h:97
uint32_t * column_oid
Definition: mvt.h:51

References mvt_agg_context::column_cache, mvt_column_cache::column_oid, mvt_agg_context::feature, mvt_agg_context::id_index, and genraster::value.

Referenced by parse_values().

Here is the caller graph for this function: