Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turf-rhumb-bearing return a valid bearing for coincident points (zero length line) #2478

Open
smallsaucepan opened this issue Aug 27, 2023 · 0 comments

Comments

@smallsaucepan
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants