Opened 12 years ago

Closed 10 years ago

#4098 closed defect (fixed)

ogr2ogr -wrapdateline fails in some cases

Reported by: floledermann Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

ogr2ogr -wrapdateline seems to cover only specific cases right now, namely polygons that cross over the dateline having positive coodinates, and only if the coordinates are within 170-190 deg.

I attached a sample shapefile with a few test cases:

0) a polygon crossing the dateline with negative coordinates 1) a polygon crossing the dateline with positive coordinates 2) a complex polygon crossing the dateline both with negative and positive coordinates 3) a degenerate case, crossing the dateline twice from negative (-185) to positive (185). This can probably not be expected to be solved correctly.

Currently only one of the cases is solved correctly by -wrapdateline (case 1). Cases 0 and 2 are not clipped at all, case 3 is clipped but degenerate (but this is probably a degenerate polygon after all that could not be expected in real life scenarios.

Attachments (7)

wrap_test.shp (804 bytes ) - added by floledermann 12 years ago.
Test shape file
wrap_test.dbf (389 bytes ) - added by floledermann 12 years ago.
wrap_test.prj (139 bytes ) - added by floledermann 12 years ago.
wrap_test.qpj (153 bytes ) - added by floledermann 12 years ago.
wrap_test.shx (132 bytes ) - added by floledermann 12 years ago.
wrapdateline_test.png (13.7 KB ) - added by floledermann 12 years ago.
Screenshot of the test shape file
wrapdateline_result.png (14.2 KB ) - added by floledermann 12 years ago.
Screenshot of the test shape file, current results after processing with -wrapdateline

Download all attachments as: .zip

Change History (9)

by floledermann, 12 years ago

Attachment: wrap_test.shp added

Test shape file

by floledermann, 12 years ago

Attachment: wrap_test.dbf added

by floledermann, 12 years ago

Attachment: wrap_test.prj added

by floledermann, 12 years ago

Attachment: wrap_test.qpj added

by floledermann, 12 years ago

Attachment: wrap_test.shx added

by floledermann, 12 years ago

Attachment: wrapdateline_test.png added

Screenshot of the test shape file

by floledermann, 12 years ago

Attachment: wrapdateline_result.png added

Screenshot of the test shape file, current results after processing with -wrapdateline

comment:1 by floledermann, 12 years ago

Summary: ogr2ogr -wrapdateline fails in most casesogr2ogr -wrapdateline fails in some cases

comment:2 by bishop, 10 years ago

Resolution: fixed
Status: newclosed
Version: unspecifiedsvn-trunk

I added support for dateline offset to provide users with capability to set different offsets than 170 to -170. Also, added new key to ogr2ogr -datelineoffset to set offset (default is 10deg = 170 to -170) I think the defect is fixed in r25642

P.S. The provided shape files is invalid, as the coordinates lie outside of 180 to -180 domain.

Note: See TracTickets for help on using tickets.