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

◆ 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);
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 contains sub-geometries or not This basically just checks that the struct ...
Definition lwgeom.c:1125
#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.
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition lwinline.h:141
uint32_t ngeoms
Definition liblwgeom.h:580
LWGEOM ** geoms
Definition liblwgeom.h:575

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

Referenced by lwcollection_extract(), and lwcollection_largest_dimension().

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