PostGIS  2.1.10dev-r@@SVN_REVISION@@
void ptarray_longitude_shift ( POINTARRAY pa)

Longitude shift for a pointarray.

Y remains the same X is converted: from -180..180 to 0..360 from 0..360 to -180..180 X < 0 becomes X + 360 X > 180 becomes X - 360

Definition at line 1378 of file ptarray.c.

References getPoint_internal(), POINTARRAY::npoints, and pixval::x.

Referenced by lwgeom_longitude_shift().

1379 {
1380  int i;
1381  double x;
1382 
1383  for (i=0; i<pa->npoints; i++)
1384  {
1385  memcpy(&x, getPoint_internal(pa, i), sizeof(double));
1386  if ( x < 0 ) x+= 360;
1387  else if ( x > 180 ) x -= 360;
1388  memcpy(getPoint_internal(pa, i), &x, sizeof(double));
1389  }
1390 }
int npoints
Definition: liblwgeom.h:327
tuple x
Definition: pixval.py:53
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1645

Here is the call graph for this function:

Here is the caller graph for this function: