#1043 closed defect (fixed)
[OverlayNG] tests/general/TestOverlayLL.xml fails
Reported by: | strk | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 3.9.0 |
Component: | Default | Version: | main |
Severity: | Unassigned | Keywords: | |
Cc: |
Description
A simple test is failing with --overlay-ng. Passes with JTS:
Description: LrL - LinearRing bug Geometry A: LINEARRING (0 0, 0 5, 5 5, 5 0, 0 0) Geometry B: LINESTRING (2 2, 5 5) Expected result: POINT (5 5) Obtained result: LINESTRING EMPTY
The test is in the tests/general/TestOverlayLL.xml file
Change History (6)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
Changing the LINEARRING type to a POLYGON or LINESTRING fixes the test, so this seems to be a simple bug which was fixed in old OverlayOP but not the new OverlayNG
comment:3 by , 4 years ago
OverlayGraph::addEdge is called only once, in GEOS, while it's called 3 times in JTS. The missing 2 times are for both directions of the linearring edge
comment:4 by , 4 years ago
Found the culprit: EdgeNodingBuilder::add, in GEOS, uses getGeometryTypeID to decide what to do, and decides to do NOTHING for LineaRing. Instead JTS uses an instanceOf operator (like a dynamic cast) which would see LinearRing as being an instance of a LINESTRING
Adding debugging to the OverlayNG GEOS class I'm seeing this graph:
The JTS class does not have a toString method, so not sure how to compare (should add one).