Skip to main content

Geospatial calculation accessor for pandas DataFrames.

Project description

pandas-xyz

Geospatial calculation accessor for pandas DataFrames.

Example Usage

pandas-xyz provides the .xyz DataFrame accessor:

>>> 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, NumPy, and SciPy are required.

The package is available on PyPi and can be installed with pip:

$ pip install pandas-xyz

License

License

This project is licensed under the MIT License. See 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

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) 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!

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

pandas-xyz-0.0.5.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

pandas_xyz-0.0.5-py3-none-any.whl (16.4 kB view hashes)

Uploaded Python 3

Supported by

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