lineOverlap does not recognize partially overlaps
jsiedentop opened this issue · comments
The lineOverlap function currently does not recognize when two lines partially overlap. This also affects booleanOverlap.
You can see it in this example:
The blue and red lines clearly overlap in the green area. However, this is not recognized because the implementation can currently only recognize an overlap if a segment is completely overlapping.
![image](https://private-user-images.githubusercontent.com/23655672/307483050-fa684a25-5bda-4b3e-a693-fe2105b1beef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4Mzc4NTYsIm5iZiI6MTcxOTgzNzU1NiwicGF0aCI6Ii8yMzY1NTY3Mi8zMDc0ODMwNTAtZmE2ODRhMjUtNWJkYS00YjNlLWE2OTMtZmUyMTA1YjFiZWVmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAxVDEyMzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4N2IzMjczMThhNWYzMDY0MmI2NzkwOGIwYjA0MTE2N2Y0YjllZGZhM2Q2MDk0YTg2OTgxODU4MDNjZTNhNmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.z0SDERUUo0dPzBNbcgUBRsPR22dc9UigG5MPy7qjL7s)
- Example on geojson.io
- Playground on jsfiddle
- GeoJson:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"stroke": "#0F0",
"fill": "#0F0",
"stroke-width": 25
},
"geometry": {
"type": "LineString",
"coordinates": [
[120, -25],
[150, -25]
]
}
},
{
"type": "Feature",
"properties": {
"stroke": "#F00",
"fill": "#F00",
"stroke-width": 10,
"stroke-opacity": 1,
"fill-opacity": 0.1
},
"geometry": {
"type": "LineString",
"coordinates": [
[120, -25],
[160, -25]
]
}
},
{
"type": "Feature",
"properties": {
"stroke": "#00F",
"fill": "#00F",
"stroke-width": 3,
"stroke-opacity": 1,
"fill-opacity": 0.1
},
"geometry": {
"type": "LineString",
"coordinates": [
[110, -25],
[150, -25]
]
}
}
]
}