PostGIS  2.5.0dev-r@@SVN_REVISION@@
void lwgeom_longitude_shift ( LWGEOM lwgeom)

Definition at line 989 of file lwgeom.c.

References COLLECTIONTYPE, LWCOLLECTION::geoms, LINETYPE, lwerror(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, LWPOLY::nrings, LWPOINT::point, LWLINE::points, LWTRIANGLE::points, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, ptarray_longitude_shift(), LWPOLY::rings, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by LWGEOM_longitude_shift().

990 {
991  uint32_t i;
992  switch (lwgeom->type)
993  {
994  LWPOINT *point;
995  LWLINE *line;
996  LWPOLY *poly;
997  LWTRIANGLE *triangle;
998  LWCOLLECTION *coll;
999 
1000  case POINTTYPE:
1001  point = (LWPOINT *)lwgeom;
1003  return;
1004  case LINETYPE:
1005  line = (LWLINE *)lwgeom;
1007  return;
1008  case POLYGONTYPE:
1009  poly = (LWPOLY *)lwgeom;
1010  for (i=0; i<poly->nrings; i++)
1011  ptarray_longitude_shift(poly->rings[i]);
1012  return;
1013  case TRIANGLETYPE:
1014  triangle = (LWTRIANGLE *)lwgeom;
1015  ptarray_longitude_shift(triangle->points);
1016  return;
1017  case MULTIPOINTTYPE:
1018  case MULTILINETYPE:
1019  case MULTIPOLYGONTYPE:
1020  case POLYHEDRALSURFACETYPE:
1021  case TINTYPE:
1022  case COLLECTIONTYPE:
1023  coll = (LWCOLLECTION *)lwgeom;
1024  for (i=0; i<coll->ngeoms; i++)
1025  lwgeom_longitude_shift(coll->geoms[i]);
1026  return;
1027  default:
1028  lwerror("lwgeom_longitude_shift: unsupported geom type: %s",
1029  lwtype_name(lwgeom->type));
1030  }
1031 }
#define LINETYPE
Definition: liblwgeom.h:85
POINTARRAY * points
Definition: liblwgeom.h:432
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:989
#define TRIANGLETYPE
Definition: liblwgeom.h:97
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
void ptarray_longitude_shift(POINTARRAY *pa)
Longitude shift for a pointarray.
Definition: ptarray.c:1411
uint32_t ngeoms
Definition: liblwgeom.h:506
POINTARRAY * point
Definition: liblwgeom.h:410
uint32_t nrings
Definition: liblwgeom.h:454
unsigned int uint32_t
Definition: uthash.h:78
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
LWGEOM ** geoms
Definition: liblwgeom.h:508
#define TINTYPE
Definition: liblwgeom.h:98
POINTARRAY ** rings
Definition: liblwgeom.h:456
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#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
POINTARRAY * points
Definition: liblwgeom.h:421

Here is the call graph for this function:

Here is the caller graph for this function: