{"id":15043595,"url":"https://github.com/ovinc/gpxo","last_synced_at":"2025-04-14T23:10:37.681Z","repository":{"id":46800653,"uuid":"328964245","full_name":"ovinc/gpxo","owner":"ovinc","description":"Load, analyze and plot GPS data from GPX files with numpy/pandas","archived":false,"fork":false,"pushed_at":"2025-01-19T17:21:54.000Z","size":7679,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T11:11:38.258Z","etag":null,"topics":["gps","gpx","numpy","pandas","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ovinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-12T11:24:14.000Z","updated_at":"2025-01-19T17:21:28.000Z","dependencies_parsed_at":"2022-08-22T23:31:09.933Z","dependency_job_id":null,"html_url":"https://github.com/ovinc/gpxo","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovinc%2Fgpxo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovinc%2Fgpxo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovinc%2Fgpxo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovinc%2Fgpxo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ovinc","download_url":"https://codeload.github.com/ovinc/gpxo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975316,"owners_count":21192210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gps","gpx","numpy","pandas","python","python3"],"created_at":"2024-09-24T20:49:19.294Z","updated_at":"2025-04-14T23:10:37.664Z","avatar_url":"https://github.com/ovinc.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"About\n=====\n\nLoad GPS data from GPX files into Python as a numpy arrays and *pandas* DataFrames. Initial parsing done using the *gpxpy* package. Trajectory plotting on a map available using *mplleaflet* (optional).\n\nQuick Start\n===========\n\nInstall\n-------\n\n```bash\npip install gpxo\n```\n\nLoad Track\n----------\n\n```python\nimport gpxo\ntrack = gpxo.Track('ExampleTrack.gpx')\n```\n(it is possible to indicate which track or segment to consider during instantiation, by default it is the first one).\n`track.data` is a *pandas* DataFrame containing time, position, elevation etc.; usual *pandas* methods can be used to analyze, manipulate and plot data. Individual columns are also available as numpy arrays as attributes of the class (see below).\n\n\nDetailed Contents\n=================\n\nTrack class\n-----------\n\nLoad, inspect and plot GPX data using the `Track` class, with the following methods and attributes.\n\n### Methods\n\n- `smooth()`: smooth position and elevation data (see `gpxo.smooth()` below),\n- `plot()`: plot trajectory data using a combination of shortnames (see shortnames below); also takes `matplotlib.pyplot.plot()` arguments/kwargs,\n- `map()`: plot trajectory on a map, using `mplleaflet.show()`,\n- `closest_to()`: find index of point in trajectory closest to a (lat, long) point.\n\n### Basic Attributes\n\n(some may not be available depending on actual data present in the GPX file)\n\n- `latitude` (numpy array): latitude in °,\n- `longitude` (numpy array): longitude in °,\n- `elevation` (numpy array): elevation in meters,\n- `time` (numpy array): local time expressed as a datetime.datetime.\n\n### Property attributes\n\n(Read-only, and calculated/updated from basic attributes; some may not be available depending on actual data present in the GPX file)\n- `seconds` (numpy array): total number of seconds since beginning of track,\n- `distance` (numpy array): total distance (km) since beginning of track,\n- `velocity` (numpy array): instantaneous velocity (km/h),\n- `compass` (numpy array): instantaneous compass bearing (°),\n- `data` (pandas DataFrame): all above attributes in a single dataframe.\n\n## Miscellaneous\n\nOutside of the `Track` class, the following standalone function is also available:\n- `compass(pt1, pt2)`: compass bearing (°) between pt1 (lat1, long1) and pt2 (lat2, long2),\n- `closest_pt(pt, trajectory)`: index of closest pt in trajectory (latitudes, longitudes) to specified pt (lat, long),\n- `smooth(x, n, window)`: smooth 1-d array with a moving window of size n and type *window*.\n\n## Short names\n\n| Short name | Corresponding data\n| :--------: | :----------------:\n|     t      |  time\n|     s      |  duration (s)\n|     d      |  distance (km)\n|     v      |  velocity (km/h)\n|     z      |  elevation (m)\n|     c      |  compass (°)\n\nExamples\n========\n\nSee Jupyter Notebook **Examples.ipynb** (https://github.com/ovinc/gpxo/blob/master/Examples.ipynb) for a detailed example using real GPX data.\n\n**Quick example 1**: Plot distance versus time and velocity versus position for a given track:\n\n```python\nimport gpxo\ntrack = gpxo.Track('ExampleTrack.gpx')\ntrack.plot('td', '--k')    # matplotlib styles can be given\ntrack.plot('dv', c='red')  # matplotlib kwargs can be passed\ntrack.data  # pandas dataframe with all data\n```\n\n**Quick example 2**: show the path of a GPX file on a map with color-coding corresponding to elevation (*see Troubleshooting section below in case of error*):\n\n```python\nimport gpxo\ntrack = gpxo.Track('ExampleTrack.gpx')\ntrack.map(plot='scatter', c=track.elevation, cmap='plasma')\n```\n\n![](https://raw.githubusercontent.com/ovinc/gpxo/master/media/map-elev.png)\n\nTroubleshooting\n===============\n\nIn case of the following error:\n```\n'XAxis' object has no attribute '_gridOnMajor\n```\n\nwhen using the `map()` method, try downgrading Matplotlib to version \u003c= 3.3.2 or install a forked version of mplleaflet (see https://github.com/jwass/mplleaflet/issues/75).\n\nInformation\n===========\n\nRequirements\n------------\n\nPython \u003e= 3.6\n\nDependencies\n------------\n\n(automatically installed by pip if necessary)\n\n- *numpy*\n- *pandas*\n- *matplotlib*\n- *importlib-metadata*\n- *gpxpy* (https://github.com/tkrajina/gpxpy)\n- *vincenty* (https://github.com/maurycyp/vincenty)\n\nOptional:\n- *mplleaflet* (https://github.com/jwass/mplleaflet)\n\nAuthor\n------\n\nOlivier Vincent\n\n(ovinc.py@gmail.com)\n\nLicense\n-------\n\nBSD 3-Clause (see *LICENCE* file)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovinc%2Fgpxo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovinc%2Fgpxo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovinc%2Fgpxo/lists"}