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

Robb K. Wright robbkwright at gmail.com
Tue Nov 19 04:19:43 PST 2013


Perfect!  The double project fits my needs exactly.

Robb


On 11/18/13 7:49 PM, Even Rouault wrote:
> Le lundi 18 novembre 2013 20:29:07, Robb K. Wright a écrit :
>> 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,
>
> I can think of 2 ways :
>
> - doing an intermediate reprojection to EPSG:3857, and then reprojecting the
> result to EPSG:4326.
>
> ogr2ogr tmp.shp test5.shp -t_srs EPSG:3857
> ogr2ogr test5_shifted.shp tmp.shp -t_srs EPSG:4326
>
> - with GDAL 1.10 and Spatialite 4.0, using the spatialite ST_Shift_Longitude()
> function :
>
> ogr2ogr test5_shifted2.shp test5.shp -dialect sqlite \
>     -sql "select ST_Shift_Longitude(geometry) as GEOMETRY, * from test5"
>
> Even
>




More information about the gdal-dev mailing list