From: Paul Ramsey Date: Sat, 29 Oct 2011 00:58:28 +0000 (+0000) Subject: Remove pglwgeom_has_bbox, pglwgeom_has_z, pglwgeom_has_m X-Git-Tag: 2.0.0alpha1~817 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed669e1e990af5d56e2dbe6c3b4d14c7c34d0192;p=postgis Remove pglwgeom_has_bbox, pglwgeom_has_z, pglwgeom_has_m git-svn-id: http://svn.osgeo.org/postgis/trunk@8040 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/g_serialized.c b/liblwgeom/g_serialized.c index 85134e13f..9799dd732 100644 --- a/liblwgeom/g_serialized.c +++ b/liblwgeom/g_serialized.c @@ -17,6 +17,21 @@ * GSERIALIZED metadata utility functions. */ +int gserialized_has_bbox(const GSERIALIZED *gser) +{ + return FLAGS_GET_BBOX(gser->flags); +} + +int gserialized_has_z(const GSERIALIZED *gser) +{ + return FLAGS_GET_Z(gser->flags); +} + +int gserialized_has_m(const GSERIALIZED *gser) +{ + return FLAGS_GET_M(gser->flags); +} + uint32_t gserialized_get_type(const GSERIALIZED *s) { uint32_t *ptr; diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 6d63fd5a7..155a00f4e 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -621,7 +621,22 @@ extern void gserialized_set_srid(GSERIALIZED *g, int32_t srid); * is zero, will not catch collections of empty, eg: * GEOMETRYCOLLECTION(POINT EMPTY) */ -int gserialized_is_empty(const GSERIALIZED *g); +extern int gserialized_is_empty(const GSERIALIZED *g); + +/** +* Check if a #GSERIALIZED has a bounding box without deserializing first. +*/ +extern int gserialized_has_bbox(const GSERIALIZED *gser); + +/** +* Check if a #GSERIALIZED has a Z ordinate. +*/ +extern int gserialized_has_z(const GSERIALIZED *gser); + +/** +* Check if a #GSERIALIZED has an M ordinate. +*/ +extern int gserialized_has_m(const GSERIALIZED *gser); /** * Call this function to drop BBOX and SRID