Count the total number of rings in any LWGEOM.
Multipolygons and other collections get counted, not the same as OGC st_numrings.
Count the total number of rings in any LWGEOM.
Definition at line 1339 of file lwgeom.c.
1340{
1341 int result = 0;
1342
1343
1345 return 0;
1346
1348 {
1356 result = 0;
1357 break;
1359 result = 1;
1360 break;
1362 result = ((
LWPOLY *)geom)->nrings;
1363 break;
1366 break;
1372 {
1374 uint32_t i = 0;
1375 for( i = 0; i < col->
ngeoms; i++ )
1377 break;
1378 }
1379 default:
1381 break;
1382 }
1383 LWDEBUGF(3,
"counted %d rings", result);
1384 return result;
1385}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define POLYHEDRALSURFACETYPE
uint32_t lwgeom_count_rings(const LWGEOM *geom)
Count rings in an LWGEOM.
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWCOLLECTION::geoms, LINETYPE, LWDEBUGF, lwerror(), lwgeom_count_rings(), lwgeom_is_empty(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, and LWGEOM::type.
Referenced by lwgeom_count_rings(), and LWGEOM_nrings().