PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ptarray_longitude_shift()

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 1637 of file ptarray.c.

1638{
1639 uint32_t i;
1640 double x;
1641
1642 for (i=0; i<pa->npoints; i++)
1643 {
1644 memcpy(&x, getPoint_internal(pa, i), sizeof(double));
1645 if ( x < 0 ) x+= 360;
1646 else if ( x > 180 ) x -= 360;
1647 memcpy(getPoint_internal(pa, i), &x, sizeof(double));
1648 }
1649}
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition lwinline.h:75
uint32_t npoints
Definition liblwgeom.h:427

References getPoint_internal(), and POINTARRAY::npoints.

Referenced by lwgeom_longitude_shift().

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