PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ LWGEOM_npoints()

Datum LWGEOM_npoints ( PG_FUNCTION_ARGS  )

Definition at line 240 of file lwgeom_functions_basic.c.

241 {
242  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
243  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
244  int npoints = 0;
245 
246  npoints = lwgeom_count_vertices(lwgeom);
247  lwgeom_free(lwgeom);
248 
249  PG_FREE_IF_COPY(geom, 0);
250  PG_RETURN_INT32(npoints);
251 }
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:1138
uint32_t lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1229

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

Here is the call graph for this function: