Skip to main content

GeoRDPy

Python 3.10 PyPI Documentation Test coverage Unit tests Code style: black

GeoRDPy is a Python library that simplifies geodetic-coordinate polylines using the Ramer-Douglas-Peucker algorithm. By default, it utilizes the distance to great-circle segments as the distance metric to reduce the number of points in a polyline while maintaining accuracy. Optionally, the segments can be interpolated with rhumb lines instead of great-circle. For both options, the great-circle distance is used internally for finding the smallest distance between the interpolated segment and geodetic-coordinate points.

Installation

GeoRDPy releases are available as wheel packages for macOS, Windows and Linux on PyPI. Install it using pip:

$ pip install geordpy

Example Usage

The GeoRDPy API is designed with simplicity in mind, featuring a single method called geordpy.rdp_filter:

>>> import geordpy
>>> points = [(latitude1, longitude1), (latitude2, longitude2), ...]
>>> threshold = 15_000  # meters
>>> mask = geordpy.rdp_filter(points, threshold)
>>> trajectory = np.array(points)[mask]

For a quick illustration of how to utilize this method, refer to the example here.

For more details, check the documentation.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to submit a pull request.

Development Setup

To set up your development environment, follow these steps:

  1. Clone the repository:

    $ git clone https://github.com/avitase/geordpy.git
    
  2. Change to the project directory:

    $ cd geordpy
    
  3. Install the development dependencies using pip:

    $ pip install -e .[dev]
    

Pre-Commit-Hooks

To maintain code quality and avoid pushing invalid commits, we recommend using pre-commit hooks. These hooks perform automated checks before commits are made. To set up pre-commit hooks, follow these steps:

  1. Install the pre-commit package (if not already installed):

    $ pip install pre-commit
    
  2. Install the hooks:

    $ pre-commit install
    

Now, each time you commit changes, the pre-commit hooks will run checks such as formatting, linting, and more. If any issues are found, they will be flagged before the commit is made.

Running Tests

You can run tests using the following command:

$ pytest

Make sure to run tests before submitting a pull request to ensure that everything is functioning as expected.

Metadata

Release files for geordpy 3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geordpy 3.1
File Size Uploaded Provenance
geordpy-3.1.tar.gz 26.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for geordpy 3.1
File Interpreter ABI Platform
geordpy-3.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.8 kB

Release files / geordpy-3.1.tar.gz

Download URL geordpy-3.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4f4a270de8ab253f29a6e7dc089c9860e07fe13bde002de461452511cc875261
BLAKE2b-256 checksum
How to use checksums
e807d0a104539173e850ccef3da6ef06116367cc8dde37fcad5630b7c3ce0b7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / geordpy-3.1-py3-none-any.whl

Download URL geordpy-3.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7673ed18cfd5dcf7d8fdf14ade1d0d9656f273eb04f13ed7b2bdeccc983b2f46
BLAKE2b-256 checksum
How to use checksums
69fea22a22e91048918051a56c03e9827db484aaa5c0b03d1dcd815fde78e641
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for geordpy 3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page