PostGIS  3.2.2dev-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 596 of file mvt.c.

597 {
598  Oid typoid = ctx->column_cache.column_oid[ctx->id_index];
599  int64_t value = INT64_MIN;
600 
601  if (isNull)
602  {
603  POSTGIS_DEBUG(3, "set_feature_id: Ignored null value");
604  return;
605  }
606 
607  switch (typoid)
608  {
609  case INT2OID:
610  value = DatumGetInt16(datum);
611  break;
612  case INT4OID:
613  value = DatumGetInt32(datum);
614  break;
615  case INT8OID:
616  value = DatumGetInt64(datum);
617  break;
618  default:
619  elog(ERROR, "set_feature_id: Feature id type does not match");
620  }
621 
622  if (value < 0)
623  {
624  POSTGIS_DEBUG(3, "set_feature_id: Ignored negative value");
625  return;
626  }
627 
628  ctx->feature->has_id = true;
629  ctx->feature->id = (uint64_t) value;
630 }
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: