Giter Club home page Giter Club logo

tracklib's Introduction

Tracklib

Tracklib library provide a variety of tools, operators and functions to manipulate GPS trajectories

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Tracklib build & test codecov Documentation Status Software License

Supported Python Versions PyPI Version PyPI Downloads zenodo

More and more datasets of GPS trajectories are now available and they are studied very frequently in many scientific domains. Currently available Python libraries for trajectories can separately load, simplify, interpolate, summarize or visualize them. But, as far as we know, there is no Python library that would contain all these basic functionalities. This is what tracklib is modestly trying to do. The library provides some conventions, capabilities and techniques to manipulate GPS trajectories.

In tracklib, the core model supports a wide range of trajectory applications:

1/ trajectory can be seen as a concept of (geo)located timestamps sequence to study for example an athlete's performance,

2/ trajectory can be seen as a concept of a curve which makes it possible to study trajectory shapes,

3/ a full trajectory dataset can be reduced into a regular grid of summarized features,

4/ with map matching process, trajectories can be seen as a network of routes.

Furthermore, adding analytical features (e.g. speed, curvilinear abscissa, inflection point, heading, acceleration, speed change, etc.) on a observation or on all observations of a trajectory (function of coordinates or timestamp) is, in general, a complex and a boring task. So, to make it easier, Tracklib module offers a multitude of operators and predicates to simplify the creation of analytical features on a GPS tracks.

The official documentation is available at ReadTheDocs

Installation

from pypi (i.e. via pip)

pip install tracklib

Features

About

version See pypi
status Since 2020 November 1st, 2020
license Cecill C

Development

Institute: LASTIG, Univ Gustave Eiffel, ENSG, IGN

Authors

tracklib's People

Contributors

lapin-solitaire avatar mbunel avatar mdvandamme avatar nhakam avatar ymeneroux avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tracklib's Issues

Time Observation Read Format when reading GPX

Hi,

I'd like to begin by thanking you for this very powerful and ambitious library I've had the pleasure of discovering recently.

However, in my usage of the library, I've encountered a problem when importing some GPX files that were generated by a fairly high frequency GPS logger that has a sampling frequency of 4 [Hz].

Below is an excerpt of a sample .gpx

<trkseg> <trkpt lat="47.7252015" lon="-3.3494651"> <time>2023-10-15T06:33:22.500000Z</time> <speed>0.2</speed> </trkpt> <trkpt lat="47.725207" lon="-3.3494624"> <time>2023-10-15T06:33:22.750000Z</time> <speed>0.1</speed> </trkpt> <trkpt lat="47.7252121" lon="-3.3494586"> <time>2023-10-15T06:33:23Z</time> <speed>0.1</speed> </trkpt> <trkpt lat="47.7252154" lon="-3.3494555"> <time>2023-10-15T06:33:23.250000Z</time> <speed>0.1</speed> </trkpt> <\trkseg>

In order to import this data I've tried setting the time observation read format, with the following command :

trk.ObsTime.setReadFormat("4Y-2M-2DT2h:2m:2s.2zZ")

However, because of the following lines in the readFromGpx() function, the track I load doesn't contain the milli-seconds part of the observation times.

format_old = ObsTime.getReadFormat()
ObsTime.setReadFormat("4Y-2M-2D 2h:2m:2s")

This is problematic for the workflow I intend to to apply to the track, where for instance I try to compute the speed, which becomes "nan" when two sucessive observations have the same timestamp.

What I would have expected is that trk.ObsTime.setReadFormat would allow to load the data from this format, but the code doesn't allow it.

One fix would be to completely bypass the aformentioned lines (as well as

# pourquoi ?
# --> pour remettre le format comme il etait avant la lecture :)
ObsTime.setReadFormat(format_old)
)?

Another would be to let the readFormat be an optional user supplied argument to readFromGpx().

I've never contributed to a public github repository before, so I don't really know the workflow, but if you are interested I can try to contribute a commit that could implement one of these solutions?

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.