PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lwgeom_longitude_shift()

void lwgeom_longitude_shift ( LWGEOM lwgeom)

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

997 {
998  uint32_t i;
999  switch (lwgeom->type)
1000  {
1001  LWPOINT *point;
1002  LWLINE *line;
1003  LWPOLY *poly;
1004  LWTRIANGLE *triangle;
1005  LWCOLLECTION *coll;
1006 
1007  case POINTTYPE:
1008  point = (LWPOINT *)lwgeom;
1010  return;
1011  case LINETYPE:
1012  line = (LWLINE *)lwgeom;
1014  return;
1015  case POLYGONTYPE:
1016  poly = (LWPOLY *)lwgeom;
1017  for (i=0; i<poly->nrings; i++)
1018  ptarray_longitude_shift(poly->rings[i]);
1019  return;
1020  case TRIANGLETYPE:
1021  triangle = (LWTRIANGLE *)lwgeom;
1022  ptarray_longitude_shift(triangle->points);
1023  return;
1024  case MULTIPOINTTYPE:
1025  case MULTILINETYPE:
1026  case MULTIPOLYGONTYPE:
1027  case POLYHEDRALSURFACETYPE:
1028  case TINTYPE:
1029  case COLLECTIONTYPE:
1030  coll = (LWCOLLECTION *)lwgeom;
1031  for (i=0; i<coll->ngeoms; i++)
1032  lwgeom_longitude_shift(coll->geoms[i]);
1033  return;
1034  default:
1035  lwerror("lwgeom_longitude_shift: unsupported geom type: %s",
1036  lwtype_name(lwgeom->type));
1037  }
1038 }
#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:996
#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:1409
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:218
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: