PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwcollection_largest_dimension()

static uint32_t lwcollection_largest_dimension ( const LWCOLLECTION col)
static

Examines contents of collection and finds the largest coordinate dimension of all components.

Areal > linear > puntal.

Definition at line 384 of file lwcollection.c.

385 {
386  int largest_type = 0;
387  size_t i;
388  for (i = 0; i < col->ngeoms; i++)
389  {
390  LWGEOM *g = col->geoms[i];
391  int gtype = lwgeom_get_type(g);
392  if (lwgeom_is_collection(g))
393  {
395  }
396 
397  if (gtype == POINTTYPE || gtype == LINETYPE || gtype == POLYGONTYPE)
398  {
399  if (gtype > largest_type)
400  largest_type = gtype;
401  }
402  }
403  return largest_type;
404 }
#define LINETYPE
Definition: liblwgeom.h:103
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:102
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1097
#define POLYGONTYPE
Definition: liblwgeom.h:104
static uint32_t lwcollection_largest_dimension(const LWCOLLECTION *col)
Examines contents of collection and finds the largest coordinate dimension of all components.
Definition: lwcollection.c:384
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition: lwinline.h:145
uint32_t ngeoms
Definition: liblwgeom.h:580
LWGEOM ** geoms
Definition: liblwgeom.h:575

References LWCOLLECTION::geoms, LINETYPE, lwgeom_get_type(), lwgeom_is_collection(), LWCOLLECTION::ngeoms, POINTTYPE, and POLYGONTYPE.

Referenced by lwcollection_extract().

Here is the call graph for this function:
Here is the caller graph for this function: