Python library for calculating geospatial data from gps coordinates.
Project description
spatialfriend
Python library for calculating geospatial data from gps coordinates.
Table of Contents
- Motivation
- The Elevation Profile Smoothing Algorithm
- Dependencies and Installation
- Example
- Project Status
- References
- Contact
- License
Motivation
Determining one's elevation on Earth's surface has become a lot easier thanks to high-accuracy consumer GPS products and digital elevation models (DEMs) of Earth's topography. Still, there are errors in GPS location and in every Earth surface model. When working with elevation and position time series, for example calculating instantaneous slopes during a trail running workout, stricter requirements are placed on the data. Even with a perfectly accurate DEM, inaccurate GPS data can yield totally unreasonable elevation profiles and path slopes, documenting work or elevation gain that the runner did not actually do. The same can be said for a perfectly accurate GPS trace on an inaccurate DEM.
The goal of this project is to take GPS data of all resolutions, and return geospatial data and calculations that actually match the athlete's experience. No more unreasonably steep slopes or noisy data in your elevation profile making running power calculations meaningless. No more adding to your workout's distance because your GPS was drifting around while you were waiting at a stoplight. No more wondering if those elevation measurements you read on GPS device or barometric altimeter are accurate. No more apples to oranges data comparisons because of differences between devices or datasets.
This package is all about being able to hit record on that device, head out for your run/hike/bike ride, and forget about it. Bring that messy activity file and we will process the data once it is all done.
The Elevation Profile Smoothing Algorithm
Example
import spatialfriend as sf
Dependencies and Installation
Base Installation
GeoPy, Google Maps, NumPy, Pandas, and SciPy are required for the base installation.
pip install spatialfriend
to install.
Extra: Elevaton values from .img
files
In addition to providing access to the Google Maps Elevation query service,
spatialfriend allows querying of user-owned .img
files that contain
elevation data. Such files are available from
the National Map's download page.
GDAL and utm are required for this extra feature.
pip install spatialfriend[img]
to install.
Extra: Elevation values from the National Map
spatialfriend allows querying of the National Map's Elevation Point Query Service. This service exposes data from the National Map's 1/3 arc-second Digital Elevation Model. 1/3 arc-second refers to the data's horizontal resolution in terms of degrees; this equates to roughly 30 meters.
requests and urllib3 are required for this extra feature.
pip install spatialfriend[tnm]
to install.
Project Status
Complete
-
Create Python package.
-
Implement a series of tests to ensure functionality as development progresses.
Current Activities
- Streamline input so user can be more hands-off.
Benchmarking and Optimization
- Benchmark algorithm performance (speed, accuracy, and consistency):
- Generate dummy series of (distance, elevation) data to check smoothing algorithm.
- Generate series of GPS points to compare elevation datasets with and without smoothing.
Future Work
- Implement an algorithm to smooth GPS position and speed data. Most GPS-enabled activity trackers filter their speed and distance timeseries to remove measurement noise. I want to try and figure out how they do it, then replicate their techniques, and compare the smoothed position data.
References
Contact
Reach out to me at one of the following places!
- Website: trailzealot.com
- LinkedIn: linkedin.com/in/aarondschroeder
- Twitter: @trailzealot
- Instagram: @trailzealot
- GitHub: github.com/aaron-schroeder
License
This project is licensed under the MIT License. See LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spatialfriend-0.0.10.tar.gz
.
File metadata
- Download URL: spatialfriend-0.0.10.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27e931529c6213f53bb4b06ac36006a47d5b345462e91121ed8ca935a17fd389 |
|
MD5 | 9db582ff381580f20cf2d4b40ae1f583 |
|
BLAKE2b-256 | d2c9fa7f482f886031f6ce6a1e3f5c205f9626c44727bfb0509f524d8de2e6ae |
File details
Details for the file spatialfriend-0.0.10-py3-none-any.whl
.
File metadata
- Download URL: spatialfriend-0.0.10-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5edc57fac6352401048903b5e88cec19bae8f12f696f6c575b620a7d4205b4d4 |
|
MD5 | 7fd38ddaf95a09393b612d63fb40875e |
|
BLAKE2b-256 | 2668b21c428e79e6ef90a7e49a176f2b929a3b683d51908122db2e2d7d284be8 |