lineOverlap for two MultiLineStrings calculated incorrectly if there is some overlapping inside each MultiLineString
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
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):

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

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the lineOverlap entry point and reproduce the case from the linked JSFiddle using the two MultiLineStrings in the issue. Compare the reported overlap with the expected complete overlap, including the shared segments within each MultiLineString; done means the overlap is displayed correctly for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100