How to overlaps line and polygon?
Open
Nobody has claimed this yet.
@turf/intersect
bug
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
Simple example. In Turfjs 5.1.6
var featureCollection = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[
28.212890625,
50.47149085139956
],
[
30.78369140625,
49.3787965643504
]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
28.71826171875,
48.821332549646634
],
[
32.16796875,
48.821332549646634
],
[
32.16796875,
50.275298611425185
],
[
28.71826171875,
50.275298611425185
],
[
28.71826171875,
48.821332549646634
]
]
]
}
}
]
};
var result = [];
result[0] = turf.intersect(featureCollection.features[0], featureCollection.features[1]);
result[1] = turf.lineOverlap(featureCollection.features[0], featureCollection.features[1]);
result[2] = turf.lineIntersect(featureCollection.features[0], featureCollection.features[1]);
Result
/*
[null,{"type":"FeatureCollection","features":[]},{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[28.71826171875,50.256687700954]}}]}]
*/
With respect, IMMSPgisgroup
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
Reproduce the example using Turf 5.1.6 and compare the results from turf.intersect, turf.lineOverlap, and turf.lineIntersect. Start by reading the documentation or entry points for those operations; done should clarify whether line-polygon overlap is supported and identify the expected result for this geometry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100