PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 645 of file mvt.c.

646{
647 Oid typoid = ctx->column_cache.column_oid[ctx->id_index];
648 int64_t value = INT64_MIN;
649
650 if (isNull)
651 {
652 POSTGIS_DEBUG(3, "set_feature_id: Ignored null value");
653 return;
654 }
655
656 switch (typoid)
657 {
658 case INT2OID:
659 value = DatumGetInt16(datum);
660 break;
661 case INT4OID:
662 value = DatumGetInt32(datum);
663 break;
664 case INT8OID:
665 value = DatumGetInt64(datum);
666 break;
667 default:
668 elog(ERROR, "set_feature_id: Feature id type does not match");
669 }
670
671 if (value < 0)
672 {
673 POSTGIS_DEBUG(3, "set_feature_id: Ignored negative value");
674 return;
675 }
676
677 ctx->feature->has_id = true;
678 ctx->feature->id = (uint64_t) value;
679}
int value
Definition genraster.py:62
VectorTile__Tile__Feature * feature
Definition mvt.h:66
uint32_t id_index
Definition mvt.h:62
mvt_column_cache column_cache
Definition mvt.h:80
uint32_t * column_oid
Definition mvt.h:51

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

Referenced by parse_values().

Here is the caller graph for this function: