Skip to main content

Analyze geospacial data tracks

Project description

Testing PyPI - Python Version PyPI - License PyPI - Version

Track analyzer

The focus of this package lies on analyzing and visualizing tracks of cycling or similar activities. Depending on the usecase settings like stopped_speed_threshold or max_speed_percentile may not be appropriate.

Installing the package with cli extra, I.e. using pip install geo-track-analyzer[cli], add utility tools. See the documentation for details.

From files

Tracks my be initialized from .gpx and .fit files using the GPXFileTrack and FITTrack object, respectively.

Programmatically

You can instanciate tracks programmatically inside your code using the PyTrack class.

PyTrack(
        points: list[tuple[float, float]] = ...,
        elevations: None | list[float] = ...,
        times: None | list[datetime] = ...,
        heartrate: None | list[int] = None,
        cadence: None | list[int] = None,
        power: None | list[int] = None,
    )

Extracting track data

The data of the track can be extracted into a pandas DataFrame object with the columns:

  • latitude: Track point latitude value
  • longitude: Track point longitude value
  • elevation: Track point elevation value
  • speed: Speed in m/s calculated relative to previous point. Requires time to be present in track.
  • distance: Distance in m relative to previous point
  • heartrate: Heartrate in bpm (if present in input)
  • cadence: Cadence in rmp(if present in input)
  • power: Power in W (if present in input)
  • time: Time in seconds relative to previous point. Time must be present in track.
  • cum_time: Cummulated time of the track/segment in seconds. Requires time to be present in track.
  • cum_time_moving: Cummulated moving time of the track/segment in seconds. Requires time to be present in track.
  • cum_distance: Cummulated distance in track/segement in meters.
  • cum_distance_moving: Cummulated moving distance in track/segement in meters.
  • cum_distance_stopped: Cummulated stopped distance in track/segement in meters.
  • moving: Bool flag specifing if the stopped_speed_threshold was exceeded for the point.

Because some values are relative to previous points, the first point in the segment is not represented in this dataframe.


Furthermore an summary of the segments and tracks can be generated in the form of a SegmentOverview containing:

  • Time in seconds (moving and totoal)
  • Distance in meters and km (moving and totoal)
  • Maximum and average velocity in m/s and km/h
  • Maximum and minimum elevation in meters
  • Uphill and downhill elevation in meters

Visualizing the track

Visualizations of a track can be generated via the plot method and the kind parameter. See documentation for further details and examples how to use the visualizations.

Extras

The following extras are provided by the lib and may be installed additionally:

  • cli: Adds cli tools for converting fit files to gpx files (extract-fit-track) and updating the elevation in a gpx file with via api (enhance-elevation)
  • postgis: Add functions for integrating with a PostGIS instance provided in the geo_track_analyzer.postgis module
  • full: Install package will all extras

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geo_track_analyzer-2.0.1.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geo_track_analyzer-2.0.1-py3-none-any.whl (65.0 kB view details)

Uploaded Python 3

File details

Details for the file geo_track_analyzer-2.0.1.tar.gz.

File metadata

  • Download URL: geo_track_analyzer-2.0.1.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geo_track_analyzer-2.0.1.tar.gz
Algorithm Hash digest
SHA256 e91ee283e2f0bd4c67c384e568073338b83bccd4b16505ccea17e6c125108fa7
MD5 79afb554d495113010d1bdb4eb41f321
BLAKE2b-256 b428e33b81c8d6ba9362332d1730098348a7468f0c30994867ba96ae42912ba8

See more details on using hashes here.

File details

Details for the file geo_track_analyzer-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: geo_track_analyzer-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 65.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for geo_track_analyzer-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39bcaf615d18353b556254a75b002d1bd12b8efe33dfd74e47c57b95f1276d5d
MD5 9e0b44f539782dc64576e3c125fc9c71
BLAKE2b-256 d2bda1b9b95dd59d7acacc22d81d2216d9cec99dea35a9dd12d89ced432aed1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page