Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lineOverlap for two MultiLineStrings calculated incorrectly if there is some overlapping inside each MultiLineString #1670

Open
theptyza opened this issue May 2, 2019 · 0 comments

Comments

@theptyza
Copy link

theptyza commented May 2, 2019

jsfiddle:
http://jsfiddle.net/theptyza/w76tqdey/

Two MultiLineStrings have some overlapping in their components.

var multiLine1 = turf.multiLineString(
    [[[0,0],[0,1],[0,2],[0,3],[1,3],[2,3]],
    [[1,3],[2,3],[2,2],[1,2],[0,2],[0,1],[0,0]]]
);

var multiLine2 = turf.multiLineString(
    [[[0,0],[0,1],[0,2],[0,3],[1,3],[2,3],[2,2]],
    [[2,3],[2,2],[1,2],[0,2],[0,1],[0,0]]]
);

In multiLine1 both lines share the [[1,3],[2,3]] part.
In multiLine2 both lines share the [[2,3],[2,2]] part.

These two multilines overlap completely, but overlap is displayed like this (multiLine1 in blue, multiLine2 in green, overlap in red):
image

If I remove the shared parts in multilines the overlap is displayed correctly
http://jsfiddle.net/theptyza/w76tqdey/3
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants