[postgis-users] Shift coordinates

Andreas Forø Tollefsen andreasft at gmail.com
Wed Nov 23 01:09:37 PST 2011


Hi,

Sorry for not thinking well enough through this before asking stupid
questions.
I fixed this by simply: UPDATE precip SET lon = lon -360 WHER lon > 180;

This shifted the coordinates > 180 to the western hemisphere.

2011/11/22 Andreas Forø Tollefsen <andreasft at gmail.com>

> 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/20111123/95ad6b29/attachment.html>


More information about the postgis-users mailing list