PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ LWGEOM_nrings()

Datum LWGEOM_nrings ( PG_FUNCTION_ARGS  )

Definition at line 254 of file lwgeom_functions_basic.c.

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

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

Here is the call graph for this function: