[postgis-users] Problem with pgsql function
pcreso at pcreso.com
Sun Sep 24 03:19:14 PDT 2006
I believe your function is intended to convert +-180 longs to 0-360.
If this is in fact the case, you might look at the shift_longitude function
introduced in PostGIS v1.1.0 (2005/12/21 according to the change log), though I
can't find it in the docs.
shift_longitude(point geom) will convert all +-180 longs to 0-360 (or vice
versa). I frequently use it to update point geometries, eg, to convert to
update table set the_geom=shift_longitude(the_geom) where x(the_geom)<0;
or the reverse:
update table set the_geom=shift_longitude(the_geom) where x(the_geom)>180;
Very handy for those of us sitting near or straddling the 180 meridian. The
where clause should be unnecessary, but seems faster if you are using a spatial
index, which we generally are :-)
More information about the postgis-users