PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ lwgeom_force_geodetic()

int lwgeom_force_geodetic ( LWGEOM geom)

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

Definition at line 3134 of file lwgeodetic.c.

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().

3135 {
3136  switch ( lwgeom_get_type(geom) )
3137  {
3138  case POINTTYPE:
3139  return lwpoint_force_geodetic((LWPOINT *)geom);
3140  case LINETYPE:
3141  return lwline_force_geodetic((LWLINE *)geom);
3142  case POLYGONTYPE:
3143  return lwpoly_force_geodetic((LWPOLY *)geom);
3144  case MULTIPOINTTYPE:
3145  case MULTILINETYPE:
3146  case MULTIPOLYGONTYPE:
3147  case COLLECTIONTYPE:
3148  return lwcollection_force_geodetic((LWCOLLECTION *)geom);
3149  default:
3150  lwerror("unsupported input geometry type: %d", lwgeom_get_type(geom));
3151  }
3152  return LW_FALSE;
3153 }
#define LINETYPE
Definition: liblwgeom.h:85
static int lwline_force_geodetic(LWLINE *line)
Definition: lwgeodetic.c:3100
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition: lwgeom.c:923
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
static int lwpoint_force_geodetic(LWPOINT *point)
Definition: lwgeodetic.c:3094
#define LW_FALSE
Definition: liblwgeom.h:76
static int lwcollection_force_geodetic(LWCOLLECTION *col)
Definition: lwgeodetic.c:3120
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
static int lwpoly_force_geodetic(LWPOLY *poly)
Definition: lwgeodetic.c:3106
#define MULTILINETYPE
Definition: liblwgeom.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: