locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.95k stars 440 forks source link

intersection returns incorrect result if polygon passes the pole area #991

Closed MansoorAhmadi closed 1 year ago

MansoorAhmadi commented 1 year ago

The intersection between two polygons or multi-polygons return an incorrect result when a polygon passes or if it's located on the pole.

We read the polygon coordinates using the WKT reader and insect using the Geometry class.

WKTReader reader = new WKTReader(jtsGeometryFactory); Geometry polygon1 = reader.read(myFirstPolygonAsString); Geometry polygon2 = reader.read(mySecondPolygonAsString);

Geometry intersection = polygon1.intersection(polygon2); if (polygon1.intersects(polygon2)) { list.add(matched polygon); }

Please, find attached a full report [with screenshots] of the bug.

We remain available, shall you have any questions.

Thank you Geometry bug report-revised.pdf

dr-jts commented 1 year ago

As mentioned in the FAQ here, JTS only supports planar coordinate systems, not geodetic ones. So I think your expectation of what the results should be is incorrect.

MansoorAhmadi commented 1 year ago

Ok. Thank you. for your reply.