PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ LWGEOM_nrings()

Datum LWGEOM_nrings ( PG_FUNCTION_ARGS  )

Definition at line 250 of file lwgeom_functions_basic.c.

References dumpnode::geom, LWGEOM_area_polygon(), lwgeom_count_rings(), lwgeom_free(), lwgeom_from_gserialized(), and PG_FUNCTION_INFO_V1().

Referenced by LWGEOM_npoints().

251 {
252  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
253  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
254  int nrings = 0;
255 
256  nrings = lwgeom_count_rings(lwgeom);
257  lwgeom_free(lwgeom);
258 
259  PG_FREE_IF_COPY(geom, 0);
260  PG_RETURN_INT32(nrings);
261 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * geom
int lwgeom_count_rings(const LWGEOM *geom)
Count the total number of rings in any LWGEOM.
Definition: lwgeom.c:1298
Here is the call graph for this function:
Here is the caller graph for this function: