spatial4j icon indicating copy to clipboard operation
spatial4j copied to clipboard

JtsGeometry.unwrapDateline creates an invalid polygon in some cases

Open tadrinth opened this issue 4 years ago • 0 comments

Start with this Geometry: POLYGON ((-180 -24.5271348, -180 0.9447814, 180 0.9447814, 180 -24.5271348, -180 -24.5271348))

Pass it to a JtsGeometry, and when unwrapDateline is called during initialization, it modifies to the following:

POLYGON ((180 -24.5271348, 180 0.9447814, 180 0.9447814, 180 -24.5271348, 180 -24.5271348))

That's not a valid polygon; note that all the -180 longitudes are now 180, so all of those points are on a straight line.

tadrinth avatar May 21 '20 19:05 tadrinth