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

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

859 {
860  int i;
861  switch (lwgeom->type)
862  {
863  LWPOINT *point;
864  LWLINE *line;
865  LWPOLY *poly;
866  LWTRIANGLE *triangle;
867  LWCOLLECTION *coll;
868 
869  case POINTTYPE:
870  point = (LWPOINT *)lwgeom;
872  return;
873  case LINETYPE:
874  line = (LWLINE *)lwgeom;
876  return;
877  case POLYGONTYPE:
878  poly = (LWPOLY *)lwgeom;
879  for (i=0; i<poly->nrings; i++)
880  ptarray_longitude_shift(poly->rings[i]);
881  return;
882  case TRIANGLETYPE:
883  triangle = (LWTRIANGLE *)lwgeom;
884  ptarray_longitude_shift(triangle->points);
885  return;
886  case MULTIPOINTTYPE:
887  case MULTILINETYPE:
888  case MULTIPOLYGONTYPE:
890  case TINTYPE:
891  case COLLECTIONTYPE:
892  coll = (LWCOLLECTION *)lwgeom;
893  for (i=0; i<coll->ngeoms; i++)
894  lwgeom_longitude_shift(coll->geoms[i]);
895  return;
896  default:
897  lwerror("lwgeom_longitude_shift: unsupported geom type: %s",
898  lwtype_name(lwgeom->type));
899  }
900 }
#define LINETYPE
Definition: liblwgeom.h:61
POINTARRAY * points
Definition: liblwgeom.h:389
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:858
#define TRIANGLETYPE
Definition: liblwgeom.h:73
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
POINTARRAY * point
Definition: liblwgeom.h:367
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
LWGEOM ** geoms
Definition: liblwgeom.h:465
#define TINTYPE
Definition: liblwgeom.h:74
POINTARRAY ** rings
Definition: liblwgeom.h:413
int nrings
Definition: liblwgeom.h:411
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
void ptarray_longitude_shift(POINTARRAY *pa)
Longitude shift for a pointarray.
Definition: ptarray.c:1378
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
uint8_t type
Definition: liblwgeom.h:352
#define MULTILINETYPE
Definition: liblwgeom.h:64
#define COLLECTIONTYPE
Definition: liblwgeom.h:66
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: