[postgis-users] Shift coordinates

Andreas Forø Tollefsen andreasft at gmail.com
Tue Nov 22 06:05:31 PST 2011


Hi all.
This might be more of a mathematical problem, but this have to do with
spatial data in my PostGIS database.

I have imported NetCDF raster data values as lat, long coordinates into a
table. Now i need to shift the location of the coordinates.
The problem is that the NetCDF raster stores its coordinates from 0 to 360.
0 is Greenwich, while 180 is 180 and 360 is again Greenwich. (see image for
detail).

What i want is to have the coordinates shifted. So that it starts at -180
for the coordinates east of the date line and centers on the prime meridian
and ends at 180.

I guess i could do this by shifting the longitude coordinates using
sin(lon), but the result is not correct. I guess the sin(lon) returns
radians, so i tried with degrees(sin(lon)) but the result was not correct.

Any ideas on how i can transform/shift these coordinates into a more
"normal" representation?

Thanks,

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111122/58f478f1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netcdf_offset.jpg
Type: image/jpeg
Size: 151095 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111122/58f478f1/attachment.jpg>


More information about the postgis-users mailing list