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

◆ LWGEOM_nrings()

Datum LWGEOM_nrings ( PG_FUNCTION_ARGS  )

Definition at line 257 of file lwgeom_functions_basic.c.

258{
259 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
260 LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
261 int nrings = 0;
262
263 nrings = lwgeom_count_rings(lwgeom);
264 lwgeom_free(lwgeom);
265
266 PG_FREE_IF_COPY(geom, 0);
267 PG_RETURN_INT32(nrings);
268}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
uint32_t lwgeom_count_rings(const LWGEOM *geom)
Count the total number of rings in any LWGEOM.
Definition lwgeom.c:1447

References lwgeom_count_rings(), lwgeom_free(), and lwgeom_from_gserialized().

Here is the call graph for this function: