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

Curt, WE7U archer at eskimo.com
Thu Jun 15 09:25:28 EDT 2006


On Tue, 13 Jun 2006, Daniel Morissette wrote:

> 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.

Hey, that brings to mind something a few things I've been wanting to ask:

*) What should an application do with a shapefile that contains
polygons with longitudes in the -189.9 to -180.0 range?  Is there an
easy way to split up the shapes so they don't fall off the edge of
the earth?

We use some NOAA Shapefiles for weather alerts that cross that
boundary and our application doesn't like them.  I can tweak the
application, so just wondering whether to do that or split the
polygons multiples across that line.  To tweak the app would mean to
draw the polygon in two pieces anyway, one on the extreme right of
the view and one on the extreme left.  A bit of a pain
programming-wise.

I contacted NOAA about the files.  They thing it's fine to have
polygons cross that boundary.  Maybe it's just me that has a problem
with it?  I suspect they use ESRI software to generate them.

*) I tried some Mars Shapefiles that range from 0-360 degrees.  Our
application doesn't like that either.  Should an application check
the bounding polygon for the Shapefile and then apply a -180 degree
shift to all the longitudes if it detects this?  What to do with
polygons that cross it's 0.0 degree boundary (basically the same
question as the first above)?

--
Curt, WE7U.   APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Gdal-dev mailing list