PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ lwgeom_longitude_shift()

void lwgeom_longitude_shift ( LWGEOM lwgeom)

Definition at line 980 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().

981 {
982  uint32_t i;
983  switch (lwgeom->type)
984  {
985  LWPOINT *point;
986  LWLINE *line;
987  LWPOLY *poly;
988  LWTRIANGLE *triangle;
989  LWCOLLECTION *coll;
990 
991  case POINTTYPE:
992  point = (LWPOINT *)lwgeom;
994  return;
995  case LINETYPE:
996  line = (LWLINE *)lwgeom;
998  return;
999  case POLYGONTYPE:
1000  poly = (LWPOLY *)lwgeom;
1001  for (i=0; i<poly->nrings; i++)
1002  ptarray_longitude_shift(poly->rings[i]);
1003  return;
1004  case TRIANGLETYPE:
1005  triangle = (LWTRIANGLE *)lwgeom;
1006  ptarray_longitude_shift(triangle->points);
1007  return;
1008  case MULTIPOINTTYPE:
1009  case MULTILINETYPE:
1010  case MULTIPOLYGONTYPE:
1011  case POLYHEDRALSURFACETYPE:
1012  case TINTYPE:
1013  case COLLECTIONTYPE:
1014  coll = (LWCOLLECTION *)lwgeom;
1015  for (i=0; i<coll->ngeoms; i++)
1016  lwgeom_longitude_shift(coll->geoms[i]);
1017  return;
1018  default:
1019  lwerror("lwgeom_longitude_shift: unsupported geom type: %s",
1020  lwtype_name(lwgeom->type));
1021  }
1022 }
#define LINETYPE
Definition: liblwgeom.h:85
POINTARRAY * points
Definition: liblwgeom.h:435
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:980
#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:1403
uint32_t ngeoms
Definition: liblwgeom.h:509
POINTARRAY * point
Definition: liblwgeom.h:413
uint32_t nrings
Definition: liblwgeom.h:457
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:216
LWGEOM ** geoms
Definition: liblwgeom.h:511
#define TINTYPE
Definition: liblwgeom.h:98
POINTARRAY ** rings
Definition: liblwgeom.h:459
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:398
#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:424
Here is the call graph for this function:
Here is the caller graph for this function: