jts icon indicating copy to clipboard operation
jts copied to clipboard

LINEARRING confuses Line Overlay

Open pramsey opened this issue 5 years ago • 2 comments

Running the existing XML tests using SnapIfNecessary (aka, making OverlayNG the default overlay implementation) and this case is an interesting failure.

	Description: GC - shows handling linear rings and linestrings
	Geometry A: GEOMETRYCOLLECTION (LINEARRING (0 0, 0 70, 80 70, 80 0, 0 0), LINESTRING (30 110, 30 30, 100 30))
	Expected result: MULTILINESTRING ((0 0, 0 70, 30 70), (30 70, 80 70, 80 30), (80 30, 80 0, 0 0), (30 110, 30 70), (30 70, 30 30, 80 30), (80 30, 100 30))
	Obtained result: LINESTRING (30 110, 30 30, 100 30)

When you change the input A from a LINEARRING to a LINESTRING the failure goes away. There's at least one other LINEARRING failure case in GEOS XML test suite, but this one seems good and illustrative.

pramsey avatar Aug 08 '20 20:08 pramsey

That is a test of UnaryUnion, in case not clear.

JTS produces the expected result using OverlayNG UnaryUnion (either called directly, or as part of OverlayNGSnapIfNeeded - not surprising, since there is no snapping invoked for this case).

So it looks like this might be a GEOS-only thing?

dr-jts avatar Aug 08 '20 20:08 dr-jts

Damn.

pramsey avatar Aug 08 '20 20:08 pramsey