Skip to main content

Simple Rammer-Douglas-Peuker algorithm implementation.

Project description

Ramer-Douglas-Peucker

Ramer-Douglas-Peucker python implementation.

Installation

pip install pyrdp

Usage

The rdp function supports both lists and numpy arrays of arbitrary dimensions.

>>> from pyrdp import rdp
>>> rdp([[0,0],[1,1],[2,0]], epsilon=1)
[[0,0],[2,0]]
>>> import numpy as np
>>> from pyrdp import rdp
>>> rdp(np.array([[0,0],[1,1],[2,0]]), epsilon=1)
array([[0,0],[2,0]])

If you specify return_mask=True the function will return a mask of the points that were kept.

>>> import numpy as np
>>> from pyrdp import rdp
>>> rdp(np.array([[0,0],[1,1],[2,0]]), epsilon=1)
array([True, False, True])

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

pyrdp-0.1.6.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

pyrdp-0.1.6-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file pyrdp-0.1.6.tar.gz.

File metadata

  • Download URL: pyrdp-0.1.6.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.9.3 CPython/3.10.6

File hashes

Hashes for pyrdp-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b889d36c3a1f5aa913c871d9a018d3c9d8da472b6a1bc569cc11b7b6c2a15889
MD5 eb2a2aeaa13eb3a8c687d2782888f624
BLAKE2b-256 e4abaf03ff063cc4c1d702c33a999de4f262253c3405ea623802594a019531d0

See more details on using hashes here.

File details

Details for the file pyrdp-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pyrdp-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.9.3 CPython/3.10.6

File hashes

Hashes for pyrdp-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e76c3f8c5364136dbb27233f4cc47062e4ad1f92dad2638e65bb0f7916926448
MD5 be3d0ef39c3117d482c70f043ed7be43
BLAKE2b-256 09355ceb767d8ff88aa5f98738eccd64398b115b89804d0774e9c5dddeceb0c5

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