[gdal-dev] ogr2ogr -wrapdateline not working

Flo Ledermann ledermann at ims.tuwien.ac.at
Fri May 27 10:02:52 EDT 2011

On 05/27/2011 12:13 PM, Even Rouault wrote:
> Selon Flo Ledermann <ledermann at ims.tuwien.ac.at>:
>> Instead I get the identical, unclipped polygon as in the input file.
>> What am I doing wrong?
> Nothing, I've checked the algorithm w.r.t your input data. The algorithm
> currently only deals with geometries overlapping the +180° meridian, not the
> -180° one (and even in the in the case of +180°, only in some restricted cases ,
> to avoid false positives). Perhaps you could file a ticket in GDAL trac with
> your data attached so that I can have a look at this again.

OK, did that and provided a better test file in there:


I checked the code and actually the assumptions sound rather limiting
first but should be OK in most real life cases I guess. So maybe for now
updating the documentation would be sufficient? I propose to put

<dt> <b>-wrapdateline</b>:</dt><dd> (starting with GDAL 1.7.0) split
geometries crossing the dateline meridian (long. = +180deg). This is
currently limited to geometry that crosses the dateline on the
"positive" side with successive vertices within 10deg of the meridian (
170deg < x1 < 180deg, 180deg < x2 < 190deg).</dd>

in gdal/apps/ogr_utilities.dox:278



More information about the gdal-dev mailing list