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/destination error with bearing=90 #681

Closed
stebogit opened this issue Apr 20, 2017 · 9 comments
Closed

@turf/destination error with bearing=90 #681

stebogit opened this issue Apr 20, 2017 · 9 comments
Labels

Comments

@stebogit
Copy link
Collaborator

I noticed the returned point is not exactly at 90 degrees from the input, i.e. the latitude changes.
I'll create an additional test in @turf/destination to highlight the error.

@stebogit stebogit added the bug label Apr 20, 2017
@DenisCarriere
Copy link
Member

👍 Thanks for reporting this @stebogit, however I believe this might be an expected result from the Haversine Formula referenced in http://www.movable-type.co.uk/scripts/latlong.html.

It would be still good to provide some test fixtures regardless of the known or not known issue.

@stebogit
Copy link
Collaborator Author

@DenisCarriere what do you think? I guess the behaviour might be unexpected to an unaware user (like me), but in fact correct.

@rowanwins
Copy link
Member

Gday @stebogit

Perhaps we just add a short note to the doco for the module that the visual output might look slightly misaligned due to the curvature of the earth, im sure someone can come up with some slightly more accurate words than those.

DenisCarriere pushed a commit that referenced this issue Apr 21, 2017
* add tests to show destination results #681

* passed units to distance() in test.js
@DenisCarriere
Copy link
Member

I'm still baffled by this issue, regardless of the Haversine Formula taking into account the curvature of the earth, one would assume by using bearing=90 your destination point result should be at the same latitude (degrees or meters).

Let's keep this issue open until we find a solution (or give up the issue and accept the curvature of the earth distortion effect).

@stebogit
Copy link
Collaborator Author

stebogit commented May 6, 2017

@DenisCarriere after some research I found out the reason why this module returns an unexpected output is that it follows a great-circle distance to take in account the earth curvature, while somebody working on a 2D map would actually expect a movement along a Rhumb line.

geodesy is a great library that implements different methods along those lines.

I'd be happy to implement like @turf/rhumb-destination, @turf/rhumb-distance and @turf/rhumb-bearing modules using that library, or maybe taking cues from it, as I believe it might result in a not lightweight dependency

cc: @rowanwins

@stebogit
Copy link
Collaborator Author

stebogit commented May 6, 2017

A module like @turf/rhumb-destination would probably also "solve" #684, as it would properly move a point of the exact/expected distance.

@DenisCarriere
Copy link
Member

DenisCarriere commented May 6, 2017

👍 @stebogit Sounds like a plan.

I like your module naming convention rhumb-<method>

@stebogit
Copy link
Collaborator Author

@turf/rhumb-destination with bearing=90 returns the expected result (a destination point at the same latitude) on a map, as a Rhumb Line is a straight line on a Mercator projection

@DenisCarriere
Copy link
Member

👍 Woohoo 🎉

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

No branches or pull requests

3 participants