PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ LWGEOM_nrings()

Datum LWGEOM_nrings ( PG_FUNCTION_ARGS  )

Definition at line 258 of file lwgeom_functions_basic.c.

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

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

Here is the call graph for this function: