spatial4j
spatial4j copied to clipboard
JtsGeometry.unwrapDateline creates an invalid polygon in some cases
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.