polygonTangents returns two of the same point
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
In certain situations, the function returns two of the same tangent, rather than the two actual tangents.
Reproduction:
const tangents = turf.polygonTangents([
-79.41285676230808,
43.627309605975235
], {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-79.428776,
43.708224
],
[
-79.325734,
43.675502
],
[
-79.414155,
43.595383
],
[
-79.353931,
43.670969
],
[
-79.428776,
43.708224
]
]
]
}
}).features.map((point) => turf.getCoord(point));
console.log(tangents) // [-79.414155,43.595383,-79.414155,43.595383]
For your convenience: https://turf-sandbox.netlify.app/
visualization
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 at the polygonTangents entry point and run the supplied reproduction to inspect why both returned coordinates are identical. Compare the result with the two actual tangents shown by the visualization; done means this case returns two distinct correct tangent points and is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100