GithubHelp home page GithubHelp logo

Comments (3)

tkrajina avatar tkrajina commented on June 4, 2024

Agree, I know this will become an issue sooner or later for somebody :) For me it isn't because I usually track my hikings or roadbike trails. But for bigger distances, this is needed.

I will implement it this week.

tk

PS. Thank for the link.

from gpxpy.

xmw avatar xmw commented on June 4, 2024

Hi,

I write an work paper in latex containing navigation points. My reference location is provided by an Garmin GPS45XL, downloaded to .gpx via gpsbabel.
I use your module to parse this [1] and provide latex/siunitx representations and distance mesurements, like '\lat{A01} & \lon{A01} & \bear{A01}{MAH} & \dist{A01}{MAH}` as seen in figure [2].

I believe the formula in [1] are correct, the distance is the haversine formula, and the bearing is as referenced on the site (from wolfram-alpha ;-).

Maybe you just implement you version and we peer review the code later ;-)

Have a nice day!

Michael

[1] https://xmw.de/tmp/gpx_calc.py
[2] https://xmw.de/tmp/tex_gpx.png
[3] http://en.wikipedia.org/wiki/Haversine_formula

from gpxpy.

tkrajina avatar tkrajina commented on June 4, 2024

Hi Michael,

I implemented haversine here a683cfa (it is not yet merged in master, it is in haversine branch). I tested a little bit with the javascript implementation from your first link and the results seems OK to me (well, not exactly the same but I think this is because the floating point).

BTW. For GPX files I decided to keep the existing algorithm for points where latitudes or longitudes differ less than 0.5 because haversine have a lot more mathematical operations. I may change this treshold (or make it configurable).

Is it really that important to you? Because it seems to me that the difference for close points is very small (and your points are close enough).

If you can test it with your script and confirm it is OK to you -- I'll merge this to the master branch.

Cheers!
tk

from gpxpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.