Comments (3)
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.
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.
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)
- NameError: free variable 'from_start_to_end' referenced before assignment in enclosing scope HOT 1
- Setup.py method is being deprecated in python package
- Confusion!
- Wrong distance? 10.4 km instead of 7.6 km HOT 1
- Save nsmap of GPX in GPXTrack, GPXTrackSegment and GPXTrackPoint
- GPX track all messed up HOT 1
- Tag a release to ship improvements since 1.5.0 HOT 1
- TypeError in gpxfield since 1.6.0 release HOT 1
- Changes Backported To 1.5.0 HOT 2
- Typo in __repr__ of SimpleTZ HOT 1
- [newbie] Wrong return type on GPXTrackSegment.get_duration() HOT 1
- create CI testing scripts HOT 1
- feature request: include distance_from_start in NearestLocationsData class HOT 1
- Is Header malformed
- Check for GPX root node on parse HOT 1
- Custom attributes in `to_xml` not escaped properly HOT 1
- Wrong type annotation for radians in method elevation angle?
- to_xml removes metadata extensions without the name tag present HOT 1
- Implement support for adding extension section to a waypoint/track/...
- Links in XML not properly encoded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpxpy.