PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_get_basic_type()

static uint8 lwgeom_get_basic_type ( LWGEOM geom)
static

Definition at line 645 of file mvt.c.

References COLLECTIONTYPE, LWCOLLECTION::geoms, LINETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, ovdump::type, and LWGEOM::type.

Referenced by mvt_geom().

646 {
647  switch(geom->type)
648  {
649  case POINTTYPE:
650  case LINETYPE:
651  case POLYGONTYPE:
652  return geom->type;
653  case MULTIPOINTTYPE:
654  case MULTILINETYPE:
655  case MULTIPOLYGONTYPE:
656  return geom->type - 3; /* Based on LWTYPE positions */
657  case COLLECTIONTYPE:
658  {
659  uint32_t i;
660  uint8 type = 0;
661  LWCOLLECTION *g = (LWCOLLECTION*)geom;
662  for (i = 0; i < g->ngeoms; i++)
663  {
664  LWGEOM *sg = g->geoms[i];
665  type = Max(type, lwgeom_get_basic_type(sg));
666  }
667  return type;
668  }
669  default:
670  elog(ERROR, "%s: Invalid type (%d)", __func__, geom->type);
671  }
672 }
#define LINETYPE
Definition: liblwgeom.h:86
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
unsigned int uint32_t
Definition: uthash.h:78
LWGEOM ** geoms
Definition: liblwgeom.h:509
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
static uint8 lwgeom_get_basic_type(LWGEOM *geom)
Definition: mvt.c:645
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
uint8_t type
Definition: liblwgeom.h:396
type
Definition: ovdump.py:41
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the caller graph for this function: