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

Bearing destination #27

Merged
merged 6 commits into from
May 4, 2015
Merged

Bearing destination #27

merged 6 commits into from
May 4, 2015

Conversation

doublestranded
Copy link

I am looking to add these (very useful!) methods: bearing and destination. The 'bearing' method calculates the angle between two lat/lngs using spherical approximation, starting at 0 degrees for due north, and increasing clockwise until 180 degrees south, at which point the values are in the range
-180 <= bearing < 0. For example, due west is -90 degrees. Destination calculates an end lat/lng from a start lat/lng, a heading, and a distance.

@leplatrem
Copy link
Collaborator

Thank you for this contribution !

It is documented and tested, well done !

Plus, I think that @kirkau will appreciate it for what he was trying to achieve in Leaflet.TextPath makinacorpus/Leaflet.TextPath#26

I let @fredericbonifas review and merge it. Just in case, please ping us here to get things moving :)

fredericbonifas added a commit that referenced this pull request May 4, 2015
@fredericbonifas fredericbonifas merged commit a0ebd04 into makinacorpus:master May 4, 2015
@doublestranded
Copy link
Author

Hi Mathieu,

Thank you for the response, and I'm glad it passed and can be useful.

However, before you and @fredericbonifas
https://github.com/fredericbonifas continue, I want you to be aware of
something. I am still kind of new to this (Github and contributing to
open-source software). I just remembered that my work is in large part
inspired from research done online into the use of spherical approximation
formulas for efficient calculation of bearing and destination, including
from this site for initial inspiration:

Chris Veness at http://www.movable-type.co.uk/scripts/latlong.html

the Wikipedia pages on spherical geometry, and stackoverflow:

http://stackoverflow.com/questions/3932502/calcute-angle-between-two-latitude-longitude-points
.

Maybe, if possible, we should attribute Chris Veness (or even bring him on
board) and cite the other sources? What I have basically done is that I
have just adapted and tested for Leaflet.GeometryUtil the formulas I
researched in the hopes it could be useful to others using the Leaflet
project, as it was to me! I apologize for any ignorance on my part, and
anyone I may have ripped off.

Thanks,
Alex

On Mon, May 4, 2015 at 3:28 PM, Mathieu Leplatre [email protected]
wrote:

Thank you for this contribution !

It is documented and tested, well done !

Plus, I think that @kirkau https://github.com/kirkau will appreciate it
for what he was trying to achieve in Leaflet.TextPath
makinacorpus/Leaflet.TextPath#26
makinacorpus/Leaflet.TextPath#26

I let @fredericbonifas https://github.com/fredericbonifas review and
merge it. Just in case, please ping us here to get things moving :)


Reply to this email directly or view it on GitHub
#27 (comment)
.

@fredericbonifas
Copy link
Collaborator

Thank you for this contribution @doublestranded, merged with pleasure!
I will tag this version as v0.3.3

I think these formulas are well-used in the geographic data utils and therefore require no attribution, but I see no problem in referencing your sources of inspiration in the code. You can provide a pull request to add these references if you want.

Thanks again :)

@doublestranded
Copy link
Author

That's great news, thanks! I will provide another pull request with updated
documentation soon.

On Mon, May 4, 2015 at 5:02 PM, Frederic Bonifas [email protected]
wrote:

Thank you for this contribution @doublestranded
https://github.com/doublestranded, merged with pleasure!
I will tag this version as v0.3.3

I think these formulas are well-used in the geographic data utils and
therefore require no attribution, but I see no problem in referencing your
sources of inspiration in the code. You can provide a pull request to add
these references if you want.

Thanks again :)


Reply to this email directly or view it on GitHub
#27 (comment)
.

@Nils-Fredrik
Copy link

👍

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

Successfully merging this pull request may close these issues.

4 participants