Registry / devops / rdp
library0.8pypypi✓ verified 86d ago

Pure Python implementation of the Ramer-Douglas-Peucker algorithm for polyline simplification. Version 0.8 (last release) is stable but low maintenance. The library provides a simple function to reduce the number of points in a curve while preserving its shape.

pip install rdp
INSTALL
IMPORT
SIG · RDP
R
rdp
devopspythonv0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rdp
from rdp import rdp
The function is named the same as the module. Some users import with alias to avoid confusion.

Simplify a 2D polyline using the Ramer-Douglas-Peucker algorithm.

import numpy as np from rdp import rdp points = np.array([[0,0],[1,0],[2,1],[3,2],[4,2]]) simplified = rdp(points, epsilon=0.5) print(simplified)
Debug
Known issues
deprecatedThe package is no longer actively maintained. Consider using alternatives like scipy.interpolate or shapely.
fix
Evaluate other libraries for ongoing support and features.
affects: >=0.8
gotchaThe rdp function requires numpy arrays with shape (N, 2). Passing lists or other shapes may cause confusing errors.
fix
Always convert input to a 2D numpy array: points = np.array(points).reshape(-1, 2)
affects: all
gotchaThe epsilon parameter is mandatory and has no default value. Forgetting it will raise TypeError.
fix
Always provide epsilon: rdp(points, epsilon=0.5)
affects: all
Errors
Common errors & fixes
TypeError: rdp() missing 1 required positional argument: 'epsilon'
epsilon parameter is required and not provided.
fix
Call rdp(points, epsilon=0.5) with an appropriate epsilon value.
IndexError: index 1 is out of bounds for axis 1 with size 1
Input array is 1D or has shape (N,) instead of (N,2).
fix
Reshape input: points = np.array(points).reshape(-1, 2)
ImportError: cannot import name 'rdp' from 'rdp' (unknown location)
Mistaken import syntax or module conflict.
fix
Use correct import: from rdp import rdp
Upgrade
Version history
0.8latest on PyPI · released Dec 19, 2016
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rdp — pip install rdp · libregistry