turf-rhumb-bearing return a valid bearing for coincident points (zero length line)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 1k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 4
Description
While taking a look at #2475 noticed turf-rhumb-bearing returns a valid bearing for a line of zero length (its points are coincident).
For example, passing the line [5, 5] -> [5, 5] into turf returns a bearing of 0 (North). This doesn't seem quite right. I understand that's what the math spits out. However, logically how can we say this line runs North? Or alternatively that it doesn't run South?
It should be invalid as it can't be determined. As a comparision Geodesy currently includes a specific check for this and returns NaN.
Please provide the following when reporting an issue:
Turf version: 6.5.0
Code snippet: Pass points at [5, 5] and [5, 5] into turf-rhumb-bearing and get a value of 0
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 turf-rhumb-bearing entry point and reproduce the case with points [5, 5] and [5, 5]. Compare the result with the issue's Geodesy reference; done means the coincident-point case is reported as indeterminate rather than as a northward bearing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 54/100