PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_longitude_shift()

void lwgeom_longitude_shift ( LWGEOM lwgeom)

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

952 {
953  int i;
954  switch (lwgeom->type)
955  {
956  LWPOINT *point;
957  LWLINE *line;
958  LWPOLY *poly;
959  LWTRIANGLE *triangle;
960  LWCOLLECTION *coll;
961 
962  case POINTTYPE:
963  point = (LWPOINT *)lwgeom;
965  return;
966  case LINETYPE:
967  line = (LWLINE *)lwgeom;
969  return;
970  case POLYGONTYPE:
971  poly = (LWPOLY *)lwgeom;
972  for (i=0; i<poly->nrings; i++)
973  ptarray_longitude_shift(poly->rings[i]);
974  return;
975  case TRIANGLETYPE:
976  triangle = (LWTRIANGLE *)lwgeom;
977  ptarray_longitude_shift(triangle->points);
978  return;
979  case MULTIPOINTTYPE:
980  case MULTILINETYPE:
981  case MULTIPOLYGONTYPE:
983  case TINTYPE:
984  case COLLECTIONTYPE:
985  coll = (LWCOLLECTION *)lwgeom;
986  for (i=0; i<coll->ngeoms; i++)
987  lwgeom_longitude_shift(coll->geoms[i]);
988  return;
989  default:
990  lwerror("lwgeom_longitude_shift: unsupported geom type: %s",
991  lwtype_name(lwgeom->type));
992  }
993 }
#define LINETYPE
Definition: liblwgeom.h:86
POINTARRAY * points
Definition: liblwgeom.h:433
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:951
#define TRIANGLETYPE
Definition: liblwgeom.h:98
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
POINTARRAY * point
Definition: liblwgeom.h:411
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:509
#define TINTYPE
Definition: liblwgeom.h:99
POINTARRAY ** rings
Definition: liblwgeom.h:457
int nrings
Definition: liblwgeom.h:455
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
void ptarray_longitude_shift(POINTARRAY *pa)
Longitude shift for a pointarray.
Definition: ptarray.c:1417
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
uint8_t type
Definition: liblwgeom.h:396
#define MULTILINETYPE
Definition: liblwgeom.h:89
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: