PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ LWGEOM_npoints()

Datum LWGEOM_npoints ( PG_FUNCTION_ARGS  )

Definition at line 239 of file lwgeom_functions_basic.c.

References dumpnode::geom, lwgeom_count_vertices(), lwgeom_free(), lwgeom_from_gserialized(), LWGEOM_nrings(), and PG_FUNCTION_INFO_V1().

Referenced by postgis_libxml_version().

240 {
241  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
242  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
243  int npoints = 0;
244 
245  npoints = lwgeom_count_vertices(lwgeom);
246  lwgeom_free(lwgeom);
247 
248  PG_FREE_IF_COPY(geom, 0);
249  PG_RETURN_INT32(npoints);
250 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * geom
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1235
Here is the call graph for this function:
Here is the caller graph for this function: