Sunday, October 4, 2015

gpxpy 1.0

It's long overdue, but the 1.0 version of my python library for parsing/manipulation of GPX files (gpxpy) is out. It contains too many changes to list them here, but it can be summarised as: gpxpy now supports both GPX 1.0 and 1.1. formats.

The 0.* version started as a utility scripts for me, it supported only some fields GPX 1.0 and I was adding more as users requested. But with time, as GPX 1.1 started to be used more, it became difficult to follow what's exactly missing in the library. People requested featured from different versions of GPX but the library nominally supported only 1.0.

After a couple of months of complete refactoring of the code to parse/serialize GPX file the new version is out. There is only one thing missing -- support for GPX 1.1. extensions. This will (probably) come later.

2 comments:

  1. Greetings Tomo,

    I've cloned the gpxpy and I am getting used to it. I come here to ask you one question. I am pzzled about one thing, I have a gpx file with points that have these attributes:


    112.90
    2016-04-26T16:21:44Z
    3d
    4
    2.6
    4.1
    4.8





    When I import(parse) the file into memory the parse function don't import the speed neither the azimuth/course, which are inside the extensions tag, but I think you had programed that in the code. Don't understand. I can send you the file for you to try yourself, no problem.

    After import the file I use the "get_speed()" function to calculate the speed of each point and then I save the value in each trackPoint.

    for track in gpxTrack.tracks:
    for segment in track.segments:
    for point in GPXTrackSegment.walk(segment, False):
    point[0].speed = GPXTrackSegment.get_speed(segment, point[1])

    Then I export to xml but again the speed it's not saved with the other fields.

    well that's it. Hope you can help :)

    best regards,
    Pedro Mendonça

    ReplyDelete
    Replies
    1. Hi Pedro.

      The reason is probably because of inconsistencies between gpx 1.0 and 1.1. See this issue for more details (and a possible solution):

      https://github.com/tkrajina/gpxpy/issues/69

      Delete