Skip to main content
https://travis-ci.org/fhirschmann/rdp.png?branch=master https://badge.fury.io/py/rdp.png Documentation Status

Python/NumPy implementation of the Ramer-Douglas-Peucker algorithm (Ramer 1972; Douglas and Peucker 1973) for 2D and 3D data.

The Ramer-Douglas-Peucker algorithm is an algorithm for reducing the number of points in a curve that is approximated by a series of points.

Installation

pip install rdp

Usage

Simple pythonic interface:

from rdp import rdp

rdp([[1, 1], [2, 2], [3, 3], [4, 4]])
[[1, 1], [4, 4]]

With epsilon=0.5:

rdp([[1, 1], [1, 1.1], [2, 2]], epsilon=0.5)
[[1.0, 1.0], [2.0, 2.0]]

Numpy interface:

import numpy as np
from rdp import rdp

rdp(np.array([1, 1, 2, 2, 3, 3, 4, 4]).reshape(4, 2))
array([[1, 1],
       [4, 4]])

References

Douglas, David H, and Thomas K Peucker. 1973. “Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or Its Caricature.” Cartographica: The International Journal for Geographic Information and Geovisualization 10 (2): 112–122.

Ramer, Urs. 1972. “An Iterative Procedure for the Polygonal Approximation of Plane Curves.” Computer Graphics and Image Processing 1 (3): 244–256.

Release files for rdp 0.8

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

Source distribution (sdist)

Source distribution for rdp 0.8
File Size Uploaded
rdp-0.8.tar.gz 4.4 kB Details

Release files / rdp-0.8.tar.gz

Download URL rdp-0.8.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
19ec92f0803587891a00b439441e5e23fc9410500983f02941e4cf9ac3113e4b
BLAKE2b-256 checksum
How to use checksums
674280a54cc4387256335c32b48bd42db80967ab5f40d6ffcd8167b3dd988c11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.8 This release

1 release file

0.7

2 release files

0.6

1 release file

0.5

1 release file

0.4

1 release file

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