geordpy

GeoRDPy is a Python library that simplifies geodetic-coordinate polylines using the Ramer-Douglas-Peucker algorithm. It reduces the number of points while preserving accuracy, making it ideal for optimizing geospatial data representations. Specify a threshold for error tolerance and choose a sphere radius for tailored simplification.

https://github.com/avitase/geordpy

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.0%) to scientific vocabulary

Keywords

geospatial great-circle great-circle-distance polylines python ramer-douglas-peucker-algorithm rhumb-line
Last synced: 6 months ago · JSON representation ·

Repository

GeoRDPy is a Python library that simplifies geodetic-coordinate polylines using the Ramer-Douglas-Peucker algorithm. It reduces the number of points while preserving accuracy, making it ideal for optimizing geospatial data representations. Specify a threshold for error tolerance and choose a sphere radius for tailored simplification.

Basic Info
  • Host: GitHub
  • Owner: avitase
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 85 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
geospatial great-circle great-circle-distance polylines python ramer-douglas-peucker-algorithm rhumb-line
Created over 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

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: bash $ pip install geordpy

Example Usage

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

import geordpy points = [(latitude1, longitude1), (latitude2, longitude2), ...] threshold = 15000 # meters mask = geordpy.rdpfilter(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: bash $ git clone https://github.com/avitase/geordpy.git

  2. Change to the project directory: bash $ cd geordpy

  3. Install the development dependencies using pip: bash $ 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): bash $ pip install pre-commit

  2. Install the hooks: bash $ 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: bash $ pytest

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

Owner

  • Name: Nis Meinert
  • Login: avitase
  • Kind: user
  • Company: Pasteur Labs

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Meinert"
  given-names: "Nis"
  orcid: "https://orcid.org/0000-0002-4712-9579"
title: "GeoRDPy"
version: 3.1
date-released: 2023-10-06
url: "https://github.com/avitase/geordpy"

GitHub Events

Total
  • Issue comment event: 2
  • Push event: 1
  • Pull request event: 2
  • Create event: 1
Last Year
  • Issue comment event: 2
  • Push event: 1
  • Pull request event: 2
  • Create event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 24
  • Average time to close issues: N/A
  • Average time to close pull requests: 4 days
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 1.25
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 16
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 7 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.67
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (26)
  • avitase (8)
Top Labels
Issue Labels
Pull Request Labels
dependencies (26)

Dependencies

.github/workflows/build_docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
.github/workflows/deploy_docs.yml actions
  • actions/configure-pages v2 composite
  • actions/deploy-pages v1 composite
  • actions/download-artifact v3 composite
  • actions/upload-pages-artifact v1 composite
.github/workflows/get_coverage.yml actions
  • MishaKav/pytest-coverage-comment v1.1.42 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pre_commit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/run_tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
docs/requirements.txt pypi
  • sphinx ==7.1.2
pyproject.toml pypi
requirements.txt pypi
  • geographiclib *
  • numpy *
  • scipy *
setup.py pypi
  • geographiclib *
  • numpy *
  • scipy *