[Gdal-dev] Tool to convert shapefile from [-180, 180] to [0, 360] range

Christopher Condit condit at sdsc.edu
Tue Jun 13 20:22:11 EDT 2006


Hi Daniel,
This is not particularly elegant, but here's a script I use to go the
other way (0 to 360 -> -180 to 180).  Just switch it and change the
values to match your files...

%gdaltx% -ot Float32 -srcwin 0 0 360 330 -a_ullr 0 89.250 180 -75.25
source.tif right.tif
%gdaltx% -ot Float32 -srcwin 360 0 360 330 -a_ullr -180 89.250 0 -75.25
source.tif left.tif
%gdalmg% -o correct.tif left.tif right.tif
%gdalinfo% -mm correct.tif

Good luck,

Chris

-----Original Message-----
From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of Daniel
Morissette
Sent: Tuesday, June 13, 2006 3:04 PM
To: gdal-dev
Subject: [Gdal-dev] Tool to convert shapefile from [-180, 180] to
[0,360] range

Is anyone aware of a tool or script that would convert the longitude of 
coordinates in a shapefile from [-180,180] to [0,360]? The tool could be

based on OGR or any other open source package.

Just checking before writing something from scratch and reinventing the 
wheel.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/
_______________________________________________
Gdal-dev mailing list
Gdal-dev at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list