[gdal-dev] ogr2og / forcing a +-180 system

Brent Wood pcreso at pcreso.com
Tue Nov 19 10:41:44 PST 2013


I suggest loading it into Postgis & use the ST_ShiftLongitude() function - this was written specifically to enable 0-360 & +-180 conversions.

It may be that your data with longitudes <-180 fails with this too, but it is the closest I know of...

Otherwise you could perhaps script something up with GMT v5, which works in mod360 for longitudes?


Brent Wood



________________________________
 From: Robb K. Wright <robbkwright at gmail.com>
To: Frank Warmerdam <warmerdam at pobox.com> 
Cc: gdal dev <gdal-dev at lists.osgeo.org> 
Sent: Tuesday, November 19, 2013 8:29 AM
Subject: Re: [gdal-dev] ogr2og / forcing a +-180 system
 



I haven't been able to get either -wrapdateline or -datelineoffset
      to alter the coords.  As far as I can figure out, the
      -wrapdateline option only operates on features that actually
      intersect the 180 line, so using it doesn't alter my coords since
      mine are only on either side.  I'm just trying to shift any polys
      <-180 to be have long +360.  Here's a sample shape if anybody
      wants to take a swing:  http://branewright.org/test/test_file.zip

Robb

On 11/18/13 12:50 PM, Frank Warmerdam wrote:

Robb, 
>
>
>Have you tried the -wrapdateline switch?  I do not believe geometries that cross the dateline will be handled ideally (they aren't split as one might hope), but if you don't have them then the rest of the geometries should be wrapped.  I see there is even now a -datelineoffset switch if someone needed 0 to 360.
>
>
>Best regards,
>Frank
>
>
>
>On Mon, Nov 18, 2013 at 8:36 AM, Robb K. Wright <robbkwright at gmail.com> wrote:
>
>
>>I need to use ogr2ogr (or any other command line) to convert
            a shapefile with longitudes spanning from -220 to -60,
            forcing it into a +-180 scheme, so the -220 coordinate would
            come out as +140 and the -60 stays as -60.  I don't need to
            worry about the polys that actually cross the 180 line.
>>
>>Any thoughts?  I was thinking that running it through
            EPSG:4326 would reshape it (as it does in Esri-land), but no
            luck.
>>
>>Robb
>>
>>
>>
>>_______________________________________________
>>gdal-dev mailing list
>>gdal-dev at lists.osgeo.org
>>http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>
>
-- 
>---------------------------------------+--------------------------------------
>I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
>light and sound - activate the windows | http://pobox.com/~warmerdam
>and watch the world go round - Rush    | Geospatial Software
        Developer
>



_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131119/faf379ac/attachment.html>


More information about the gdal-dev mailing list