PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum LWGEOM_npoints ( PG_FUNCTION_ARGS  )

Definition at line 236 of file lwgeom_functions_basic.c.

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

237 {
238  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
239  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
240  int npoints = 0;
241 
242  npoints = lwgeom_count_vertices(lwgeom);
243  lwgeom_free(lwgeom);
244 
245  PG_FREE_IF_COPY(geom, 0);
246  PG_RETURN_INT32(npoints);
247 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1137
LWGEOM * geom
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1228

Here is the call graph for this function: