PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwgeom_longitude_shift()

void lwgeom_longitude_shift ( LWGEOM lwgeom)

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

916 {
917  int i;
918  switch (lwgeom->type)
919  {
920  LWPOINT *point;
921  LWLINE *line;
922  LWPOLY *poly;
923  LWTRIANGLE *triangle;
924  LWCOLLECTION *coll;
925 
926  case POINTTYPE:
927  point = (LWPOINT *)lwgeom;
929  return;
930  case LINETYPE:
931  line = (LWLINE *)lwgeom;
933  return;
934  case POLYGONTYPE:
935  poly = (LWPOLY *)lwgeom;
936  for (i=0; i<poly->nrings; i++)
937  ptarray_longitude_shift(poly->rings[i]);
938  return;
939  case TRIANGLETYPE:
940  triangle = (LWTRIANGLE *)lwgeom;
941  ptarray_longitude_shift(triangle->points);
942  return;
943  case MULTIPOINTTYPE:
944  case MULTILINETYPE:
945  case MULTIPOLYGONTYPE:
947  case TINTYPE:
948  case COLLECTIONTYPE:
949  coll = (LWCOLLECTION *)lwgeom;
950  for (i=0; i<coll->ngeoms; i++)
951  lwgeom_longitude_shift(coll->geoms[i]);
952  return;
953  default:
954  lwerror("lwgeom_longitude_shift: unsupported geom type: %s",
955  lwtype_name(lwgeom->type));
956  }
957 }
#define LINETYPE
Definition: liblwgeom.h:85
POINTARRAY * points
Definition: liblwgeom.h:432
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:915
#define TRIANGLETYPE
Definition: liblwgeom.h:97
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
POINTARRAY * point
Definition: liblwgeom.h:410
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
LWGEOM ** geoms
Definition: liblwgeom.h:508
#define TINTYPE
Definition: liblwgeom.h:98
POINTARRAY ** rings
Definition: liblwgeom.h:456
int nrings
Definition: liblwgeom.h:454
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
void ptarray_longitude_shift(POINTARRAY *pa)
Longitude shift for a pointarray.
Definition: ptarray.c:1421
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#define MULTILINETYPE
Definition: liblwgeom.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
POINTARRAY * points
Definition: liblwgeom.h:421
Here is the call graph for this function:
Here is the caller graph for this function: