PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_longitude_shift()

void lwgeom_longitude_shift ( LWGEOM lwgeom)

Definition at line 996 of file lwgeom.c.

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 COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define TINTYPE
Definition: liblwgeom.h:99
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define TRIANGLETYPE
Definition: liblwgeom.h:98
void ptarray_longitude_shift(POINTARRAY *pa)
Longitude shift for a pointarray.
Definition: ptarray.c:1416
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:996
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
uint8_t type
Definition: liblwgeom.h:399
POINTARRAY * points
Definition: liblwgeom.h:425
POINTARRAY * point
Definition: liblwgeom.h:414
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint32_t nrings
Definition: liblwgeom.h:458
POINTARRAY * points
Definition: liblwgeom.h:436
unsigned int uint32_t
Definition: uthash.h:78

References COLLECTIONTYPE, LWCOLLECTION::geoms, LINETYPE, lwerror(), lwgeom_longitude_shift(), 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(), and LWGEOM_longitude_shift().

Here is the call graph for this function:
Here is the caller graph for this function: