PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_get_basic_type()

static uint8 lwgeom_get_basic_type ( LWGEOM geom)
static

Definition at line 734 of file mvt.c.

735 {
736  switch(geom->type)
737  {
738  case POINTTYPE:
739  case LINETYPE:
740  case POLYGONTYPE:
741  return geom->type;
742  case MULTIPOINTTYPE:
743  case MULTILINETYPE:
744  case MULTIPOLYGONTYPE:
745  return geom->type - 3; /* Based on LWTYPE positions */
746  case COLLECTIONTYPE:
747  {
748  uint32_t i;
749  uint8 type = 0;
750  LWCOLLECTION *g = (LWCOLLECTION*)geom;
751  for (i = 0; i < g->ngeoms; i++)
752  {
753  LWGEOM *sg = g->geoms[i];
754  type = Max(type, lwgeom_get_basic_type(sg));
755  }
756  return type;
757  }
758  default:
759  elog(ERROR, "%s: Invalid type (%d)", __func__, geom->type);
760  }
761 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
static uint8 lwgeom_get_basic_type(LWGEOM *geom)
Definition: mvt.c:734
type
Definition: ovdump.py:41
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
uint8_t type
Definition: liblwgeom.h:399
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by mvt_clip_and_validate_geos(), and mvt_geom().

Here is the caller graph for this function: