Comments (2)
I'm not on my computer now, but there was a similar issue recently. I
pushed a branch which fixes it and maybe it fixes your one, too. It's not
yet merged in master. Can you try it to see if it works properly there?
On Sat, May 28, 2016, 07:24 tmecha [email protected] wrote:
Using gpxpy 1.1.1, GPX 1.1, and python 3.4
I had some issues where tags were missing, turn out if gpx_point.elevation
= 0 as floating point type then tag doesn't make it through.A couple locations where elevation = 0 fails comparisons:
gpx.py line 1280 in def has_elevations(self):
if track_point.elevation:
found += 1I changed this to:
if track_point.elevation is not None:
found += 1This way the value of 0 is still allowed.
I also believe the following statement in gpxfield.py incorrectly removes
a 0 tag:
def to_xml(self, value, version):
if not value:
return ''and should be:
def to_xml(self, value, version):
if value is None:
return ''There must be another location where elevation==0 gets filtered out. I
made it this far then was in time crunch so did my own conversion of float
to string when assigning elevation and it worked.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#62, or mute the thread
https://github.com/notifications/unsubscribe/AAXJa3loAy2tLF1tRLPoatsnknJ8z01sks5qF9GcgaJpZM4Io_9o
.:wq!
from gpxpy.
Merged to master, it should work now:
$ python -m unittest test.MinidomTests.test_zero_latlng
<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd" version="1.0" creator="gpx.py -- https://github.com/tkrajina/gpxpy">
<trk>
<trkseg>
<trkpt lat="0" lon="0">
<ele>0</ele></trkpt></trkseg></trk></gpx>
from gpxpy.
Related Issues (20)
- GPX parsing not working with extension HOT 2
- 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/...
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.