311{
314 int dimension = -1;
315
318 PG_FREE_IF_COPY(geom, 0);
319
320 if ( dimension < 0 )
321 {
322 elog(NOTICE, "Could not compute geometry dimensions");
323 PG_RETURN_NULL();
324 }
325
326 PG_RETURN_INT32(dimension);
327}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
int lwgeom_dimension(const LWGEOM *geom)
For an LWGEOM, returns 0 for points, 1 for lines, 2 for polygons, 3 for volume, and the max dimension...