tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
1.02k stars 223 forks source link

Splits calculation #70

Closed bjorntheart closed 8 years ago

bjorntheart commented 8 years ago

Is it possible to calculate kilometer(km) splits including data such as km, pace, (+-) elevation with this tool?

I also noticed that point.speed is None, but point.exentions['gpxdata:speed] is populated. What is the extensions attribute? I couldn't find any helpful resources online.

tkrajina commented 8 years ago

If your "splits" are already stored as tracks/segments of a GPX file, you can use gpxinfo for something similar.

Your point.exentions['gpxdata:speed] is populated because your GPX (1.1) file probably have <extensions><gpxdata:speed>...</gpxdata:speed></extenstions> stored for every point.

See here: https://github.com/tkrajina/gpxpy/issues/69 for a better description on the missing speed attribute.

bjorntheart commented 8 years ago

Thanks. I'll read through the issue.

I guess I can run the gpxinfo utility every time a gpx file is uploaded to my web app. I'll have to write a parser to strip out the labels(description for the data for each line) for each line to get the raw data for example: Moving time: 00:51:39 becomes 00:51:39

Is the raw information, without the labels, available through gpxpy parser or something?

tkrajina commented 8 years ago

If your webapp is in python, why don't you just copy-paste and change the code from https://github.com/tkrajina/gpxpy/blob/master/gpxinfo ? If you plan to execute gpxinfo -- you can change the code to make the output whatever you want.

In case you want a faster solution, you can use my Golang port of gpxpy: https://github.com/tkrajina/gpxgo

I can't help more than this.