443{
446 int dimension = -1;
447
450 PG_FREE_IF_COPY(geom, 0);
451
452 if ( dimension < 0 )
453 {
454 elog(NOTICE, "Could not compute geometry dimensions");
455 PG_RETURN_NULL();
456 }
457
458 PG_RETURN_INT32(dimension);
459}
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...