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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pandas-xyz-0.0.5.tar.gz.

File metadata

  • Download URL: pandas-xyz-0.0.5.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.5

File hashes

Hashes for pandas-xyz-0.0.5.tar.gz
Algorithm Hash digest
SHA256 934cbaab79e13f64182b57b211c45bb6c8e82865361730f354d0f6a3053f33b3
MD5 b170d7e5299939325e4145988b526379
BLAKE2b-256 9748c849337d0cc24de583376a719b8a4183c9da534a499493a069f2677597b4

See more details on using hashes here.

File details

Details for the file pandas_xyz-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pandas_xyz-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.5

File hashes

Hashes for pandas_xyz-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 38176da3b0e5c9b69b5aadfcadf66a23abeb3192a4b7067c7e4ccca88ef98781
MD5 ea5cf79c8ce0d1165d795d5498cc6fe2
BLAKE2b-256 688032ef1393195f446e6a66abe1ceee5a1abbb7cad5855a8da46b90c664c2e2

See more details on using hashes here.

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