PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ LWGEOM_numgeometries_collection()

Datum LWGEOM_numgeometries_collection ( PG_FUNCTION_ARGS  )

Definition at line 277 of file lwgeom_ogc.c.

278{
279 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
280 LWGEOM *lwgeom;
281 int32 ret = 0;
282
283 lwgeom = lwgeom_from_gserialized(geom);
284
285 /* TIN and PolyhedralSurface count as 1 geometry, not their patch count */
286 ret = lwgeom_count_geometries(lwgeom, false);
287
288 lwgeom_free(lwgeom);
289 PG_FREE_IF_COPY(geom, 0);
290 PG_RETURN_INT32(ret);
291}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
static int32 lwgeom_count_geometries(LWGEOM *lwgeom, bool patches_as_geometries)
Definition lwgeom_ogc.c:246
unsigned int int32
Definition shpopen.c:54

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

Here is the call graph for this function: