PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum LWGEOM_nrings ( PG_FUNCTION_ARGS  )

Definition at line 235 of file lwgeom_functions_basic.c.

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

236 {
237  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
238  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
239  int nrings = 0;
240 
241  nrings = lwgeom_count_rings(lwgeom);
242  lwgeom_free(lwgeom);
243 
244  PG_FREE_IF_COPY(geom, 0);
245  PG_RETURN_INT32(nrings);
246 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * geom
int lwgeom_count_rings(const LWGEOM *geom)
Count the total number of rings in any LWGEOM.
Definition: lwgeom.c:1249

Here is the call graph for this function: