https://github.com/aaron-schroeder/pandas-xyz
Geospatial calculation accessor for pandas DataFrames
https://github.com/aaron-schroeder/pandas-xyz
elevation gis gps pandas scipy
Last synced: 2 months ago
JSON representation
Geospatial calculation accessor for pandas DataFrames
- Host: GitHub
- URL: https://github.com/aaron-schroeder/pandas-xyz
- Owner: aaron-schroeder
- License: mit
- Created: 2021-01-17T19:48:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T16:48:54.000Z (over 2 years ago)
- Last Synced: 2025-02-07T07:37:54.303Z (3 months ago)
- Topics: elevation, gis, gps, pandas, scipy
- Language: Python
- Homepage:
- Size: 1.37 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pandas-xyz
Geospatial calculation accessor for pandas DataFrames.
## Example Usage
pandas-xyz provides the `.xyz` DataFrame accessor:
```python
>>> import pandas as pd
>>> import pandas_xyz>>> df = pd.DataFrame.from_dict({
... 'lat': [40.0, 40.1, 40.3],
... 'lon': [-105.0, -105.0, -105.0]
... })>>> df['displacement'] = df.xyz.ds_from_xy()
>>> df['displacement']
0 0.000000
1 11119.492664
2 22238.985329
dtype: float64>>> df.xyz.s_from_ds()
0 0.000000
1 11119.492664
2 33358.477993
dtype: float64
```## Dependencies and Installation
[Pandas](https://pandas.pydata.org/), [NumPy](https://numpy.org/), and [SciPy](https://www.scipy.org/) are required.
The package is available on [PyPi](https://pypi.org/project/pandas-xyz) and can be installed with `pip`:
```
$ pip install pandas-xyz
```## License
[](http://badges.mit-license.org)
This project is licensed under the MIT License. See
[LICENSE](https://github.com/aaron-schroeder/pandas-xyz/blob/master/LICENSE)
file for details.## Documentation
The official documentation is hosted at readthedocs: https://pandas-xyz.readthedocs.io/en/stable/
## The Elevation Smoothing Algorithm
The algorithm I apply to filter elevation time series is based on a paper produced by
the National Renewable Energy Laboratory. Their algorithm is meant to smooth the elevation
time series of a moving vehicle for more reasonable estimates of road grades for energy consumption
models. This actually isn't that different from my end goal of smoothing elevation series for
more reasonable estimates of elevation gain and energy consumption by ambulating humans!
The paper is included in the
[resources folder](https://github.com/aaron-schroeder/pandas-xyz/blob/master/resources/elevation_filtering_nrel.pdf)## Project Status
### Complete
- Implement an algorithm to smooth noisy elevation time series.
- Implement a smoothing algorithm for elevation series as a function of
distance (similar to how the completed time-smoother works.)### Current Activities
- 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.
- Develop and document a variety of elevation gain/loss algorithms.
- Describe the algorithms in more detail. Maybe in a wiki?
- Provide references to papers and other resources where I got inspiration
for each algorithm.### Future Work
- Benchmark algorithm performance (speed, accuracy, and consistency):
- Generate dummy time series of (distance, elevation) data to check
smoothing algorithm.
- Generate series of GPS points to obtain elevation coordinates from
various DEMs (using [`elevation-query` package](https://github.com/aaron-schroeder/elevation-query))
to compare elevation datasets with and without smoothing.
- Create gain/loss algorithms to emulate those employed by
Strava / TrainingPeaks / Garmin.## Contact
Reach out to me at one of the following places!
- Website: [trailzealot.com](https://trailzealot.com)
- LinkedIn: [linkedin.com/in/aarondschroeder](https://www.linkedin.com/in/aarondschroeder/)
- Twitter: [@trailzealot](https://twitter.com/trailzealot)
- Instagram: [@trailzealot](https://instagram.com/trailzealot)
- GitHub: [github.com/aaron-schroeder](https://github.com/aaron-schroeder)