PostGIS  2.2.8dev-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 2809 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().

2810 {
2811  switch ( lwgeom_get_type(geom) )
2812  {
2813  case POINTTYPE:
2814  return lwpoint_force_geodetic((LWPOINT *)geom);
2815  case LINETYPE:
2816  return lwline_force_geodetic((LWLINE *)geom);
2817  case POLYGONTYPE:
2818  return lwpoly_force_geodetic((LWPOLY *)geom);
2819  case MULTIPOINTTYPE:
2820  case MULTILINETYPE:
2821  case MULTIPOLYGONTYPE:
2822  case COLLECTIONTYPE:
2823  return lwcollection_force_geodetic((LWCOLLECTION *)geom);
2824  default:
2825  lwerror("unsupported input geometry type: %d", lwgeom_get_type(geom));
2826  }
2827  return LW_FALSE;
2828 }
#define LINETYPE
Definition: liblwgeom.h:71
static int lwline_force_geodetic(LWLINE *line)
Definition: lwgeodetic.c:2775
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition: lwgeom.c:829
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
static int lwpoint_force_geodetic(LWPOINT *point)
Definition: lwgeodetic.c:2769
#define LW_FALSE
Definition: liblwgeom.h:62
static int lwcollection_force_geodetic(LWCOLLECTION *col)
Definition: lwgeodetic.c:2795
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
static int lwpoly_force_geodetic(LWPOLY *poly)
Definition: lwgeodetic.c:2781
#define MULTILINETYPE
Definition: liblwgeom.h:74
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76
Here is the call graph for this function:
Here is the caller graph for this function: