You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
intersection returns geometrically degenerate linestring (size < 2) for tangent line #1448
I'd have hoped for Result size: 0 because there is actually no intersection for all practical purposes well, that's bit far.. I understand that it's geometrically correct that the intersection is a point, but type-wise it's more a bug IMHO to return an invalid linestring type.
Sorry if this is a duplicate, skimming the issues didn't surface anything like-wise.
⎯ Intersection (anotherGeometry: Geometry): Geometry — Returns a geometric object that represents the
Point set intersection of this geometric object with anotherGeometry.
[...]
Polygons are topologically closed; [i.e. they include their boundary points]
[...]
A Curve is defined as topologically closed, that is, it contains its endpoints f(a) and f(b).
[...]
A LineString is a Curve
So the intersection being non-empty is correct geometrically and also by specification. But from my understanding LINESTRING(x y) is also not a valid LINESTRING but only a valid POINT (I cannot find specific wording in the OGC that prohibits this, but all examples of linestrings, lines and curves strongly indicate this).
Changing the behaviour here sounds very dangerous. I propose to mark this wontfix and to document in the operations that degenerate output geometries are possible when the correct result is neither empty nor representable in the given output type.
Otherwise it would be necessary to either change behaviour that users may already rely on, silently violate the spec of the operation, silently violate the spec of the output geometry or requiring the output for every overlay operation to be of some collection of variations type (which would also break user code).
Activity
tinko92 commentedon Apr 16, 2026
I don't get your output. I think
should be
From the OGC SFS
So the intersection being non-empty is correct geometrically and also by specification. But from my understanding LINESTRING(x y) is also not a valid LINESTRING but only a valid POINT (I cannot find specific wording in the OGC that prohibits this, but all examples of linestrings, lines and curves strongly indicate this).
Changing the behaviour here sounds very dangerous. I propose to mark this wontfix and to document in the operations that degenerate output geometries are possible when the correct result is neither empty nor representable in the given output type.
Otherwise it would be necessary to either change behaviour that users may already rely on, silently violate the spec of the operation, silently violate the spec of the output geometry or requiring the output for every overlay operation to be of some collection of variations type (which would also break user code).