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

◆ lwgeom_force_geodetic()

int lwgeom_force_geodetic ( LWGEOM geom)

Force coordinates of LWGEOM into geodetic range (-180, -90, 180, 90)

Definition at line 3070 of file lwgeodetic.c.

3071{
3072 switch ( lwgeom_get_type(geom) )
3073 {
3074 case POINTTYPE:
3075 return lwpoint_force_geodetic((LWPOINT *)geom);
3076 case LINETYPE:
3077 return lwline_force_geodetic((LWLINE *)geom);
3078 case POLYGONTYPE:
3079 return lwpoly_force_geodetic((LWPOLY *)geom);
3080 case MULTIPOINTTYPE:
3081 case MULTILINETYPE:
3082 case MULTIPOLYGONTYPE:
3083 case COLLECTIONTYPE:
3085 default:
3086 lwerror("unsupported input geometry type: %d", lwgeom_get_type(geom));
3087 }
3088 return LW_FALSE;
3089}
#define LW_FALSE
Definition liblwgeom.h:94
#define COLLECTIONTYPE
Definition liblwgeom.h:108
#define MULTILINETYPE
Definition liblwgeom.h:106
#define LINETYPE
Definition liblwgeom.h:103
#define MULTIPOINTTYPE
Definition liblwgeom.h:105
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:102
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:107
#define POLYGONTYPE
Definition liblwgeom.h:104
static int lwpoly_force_geodetic(LWPOLY *poly)
static int lwcollection_force_geodetic(LWCOLLECTION *col)
static int lwline_force_geodetic(LWLINE *line)
static int lwpoint_force_geodetic(LWPOINT *point)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition lwinline.h:141

References COLLECTIONTYPE, LINETYPE, LW_FALSE, lwcollection_force_geodetic(), lwerror(), lwgeom_get_type(), lwline_force_geodetic(), lwpoint_force_geodetic(), lwpoly_force_geodetic(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, and POLYGONTYPE.

Referenced by geography_from_geometry(), gserialized_geography_from_lwgeom(), and lwcollection_force_geodetic().

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