Giter VIP home page Giter VIP logo

pygpx's Introduction

This library is designed for parsing and manipulating gpx files in Python.

This project originally started: http://www.benno.id.au/code/pygpx/ by Ben Leslie. Modified by Nick Lang to work with GPX v1.1: https://github.com/fxdgear/pygpx

I am modifying it further. Changes are in CHANGE-LOG.

Prerequisites

Required by pygpx:

  • lxml
pygpx has now been converted to v0.3.
  • v0.3 now supports the GPX schema v1.1. All files using pygpx should validate against v1.1
  • pygpx now ships with the schema v1.1 and will run a validation test before running.
  • Garmin supports exporting files to GPX valid against v1.1 so you shouldn't have any problems if you're using garmin software.

Tests

nosetests

API example:

from pygpx import GPX
gpx = GPX("some_data.gpx")
tracks = gpx.tracks
for track in tracks:
    print track.name
    for trkseg in track.trksegs:
        for trkpnt in trkseg.trkpts:
            print trkpnt.lat
            print trkpnt.lon
            print trkpnt.elevation
            print trkpnt.hr
            print trkpnt.time

    print track.full_duration()
    print track.distance()

pygpx's People

Contributors

dudarev avatar fxdgear avatar vutshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pygpx's Issues

Date time parsing issue

Currently, the UTC date time in a GPX file is not parsed with UTC time zone.

A suggestion is to use the python-dateutil and replace the current parsing approach with dateutil.parser.

import dateutil.parser

def datetime_iso(string):
"""Parse an ISO formatted string. E.g:
2006-01-08T06:45:07Z
Modified by W. K. Lo 2016-06-09

Return a datetime object.
"""
dt = dateutil.parser.parse(string)
return dt

Hope this fit with other parts well!

Regards,
wklogoo

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.