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

◆ lwgeom_check_geodetic()

int lwgeom_check_geodetic ( const LWGEOM geom)
extern

Check that coordinates of LWGEOM are all within the geodetic range (-180, -90, 180, 90)

Definition at line 3131 of file lwgeodetic.c.

3132{
3133 if ( lwgeom_is_empty(geom) )
3134 return LW_TRUE;
3135
3136 switch (geom->type)
3137 {
3138 case POINTTYPE:
3139 return lwpoint_check_geodetic((LWPOINT *)geom);
3140 case LINETYPE:
3141 return lwline_check_geodetic((LWLINE *)geom);
3142 case POLYGONTYPE:
3143 return lwpoly_check_geodetic((LWPOLY *)geom);
3144 case TRIANGLETYPE:
3145 return lwtriangle_check_geodetic((LWTRIANGLE *)geom);
3146 case MULTIPOINTTYPE:
3147 case MULTILINETYPE:
3148 case MULTIPOLYGONTYPE:
3150 case TINTYPE:
3151 case COLLECTIONTYPE:
3153 default:
3154 lwerror("lwgeom_check_geodetic: unsupported input geometry type: %d - %s",
3155 geom->type, lwtype_name(geom->type));
3156 }
3157 return LW_FALSE;
3158}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition lwutil.c:216
#define LW_FALSE
Definition liblwgeom.h:108
#define COLLECTIONTYPE
Definition liblwgeom.h:122
#define MULTILINETYPE
Definition liblwgeom.h:120
#define LINETYPE
Definition liblwgeom.h:117
#define MULTIPOINTTYPE
Definition liblwgeom.h:119
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:116
#define TINTYPE
Definition liblwgeom.h:130
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:121
#define POLYGONTYPE
Definition liblwgeom.h:118
#define POLYHEDRALSURFACETYPE
Definition liblwgeom.h:128
#define TRIANGLETYPE
Definition liblwgeom.h:129
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:107
static int lwline_check_geodetic(const LWLINE *line)
static int lwcollection_check_geodetic(const LWCOLLECTION *col)
static int lwpoly_check_geodetic(const LWPOLY *poly)
static int lwtriangle_check_geodetic(const LWTRIANGLE *triangle)
static int lwpoint_check_geodetic(const LWPOINT *point)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition lwutil.c:190
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition lwinline.h:193
uint8_t type
Definition liblwgeom.h:448

References COLLECTIONTYPE, LINETYPE, LW_FALSE, LW_TRUE, lwcollection_check_geodetic(), lwerror(), lwgeom_is_empty(), lwline_check_geodetic(), lwpoint_check_geodetic(), lwpoly_check_geodetic(), lwtriangle_check_geodetic(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, LWGEOM::type, and LWPOINT::type.

Referenced by lwcollection_check_geodetic(), and test_lwgeom_check_geodetic().

Here is the call graph for this function:
Here is the caller graph for this function: