PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_longitude_shift()

void lwgeom_longitude_shift ( LWGEOM lwgeom)

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

903 {
904  int i;
905  switch (lwgeom->type)
906  {
907  LWPOINT *point;
908  LWLINE *line;
909  LWPOLY *poly;
910  LWTRIANGLE *triangle;
911  LWCOLLECTION *coll;
912 
913  case POINTTYPE:
914  point = (LWPOINT *)lwgeom;
916  return;
917  case LINETYPE:
918  line = (LWLINE *)lwgeom;
920  return;
921  case POLYGONTYPE:
922  poly = (LWPOLY *)lwgeom;
923  for (i=0; i<poly->nrings; i++)
924  ptarray_longitude_shift(poly->rings[i]);
925  return;
926  case TRIANGLETYPE:
927  triangle = (LWTRIANGLE *)lwgeom;
928  ptarray_longitude_shift(triangle->points);
929  return;
930  case MULTIPOINTTYPE:
931  case MULTILINETYPE:
932  case MULTIPOLYGONTYPE:
934  case TINTYPE:
935  case COLLECTIONTYPE:
936  coll = (LWCOLLECTION *)lwgeom;
937  for (i=0; i<coll->ngeoms; i++)
938  lwgeom_longitude_shift(coll->geoms[i]);
939  return;
940  default:
941  lwerror("lwgeom_longitude_shift: unsupported geom type: %s",
942  lwtype_name(lwgeom->type));
943  }
944 }
#define LINETYPE
Definition: liblwgeom.h:71
POINTARRAY * points
Definition: liblwgeom.h:417
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:902
#define TRIANGLETYPE
Definition: liblwgeom.h:83
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:82
POINTARRAY * point
Definition: liblwgeom.h:395
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
LWGEOM ** geoms
Definition: liblwgeom.h:493
#define TINTYPE
Definition: liblwgeom.h:84
POINTARRAY ** rings
Definition: liblwgeom.h:441
int nrings
Definition: liblwgeom.h:439
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
void ptarray_longitude_shift(POINTARRAY *pa)
Longitude shift for a pointarray.
Definition: ptarray.c:1414
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
#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
POINTARRAY * points
Definition: liblwgeom.h:406
Here is the call graph for this function:
Here is the caller graph for this function: