Curve simplification per Ramer-Douglas-Peucker.
Project description
curvereduce
This is an implementation of the Ramer-Douglas-Peucker curve simplification algorithm in Python.
Usage
Install from the PyPi package repository using pip install curvereduce
.
from curvereduce import simplify_curve, simplify_curve_to
points = [
(1.20401E-09, -0.00120428 ),
(0.018, 0.241799 ),
(0.1044, 1.34392 ),
...
]
# use an explicit epsilon value
simplified_1 = simplify_curve(points, 0.1075)
# or specify a number of points you want to end up with
simplified_2 = simplify_curve_to(points, 20)
License
This work is licensed under the MIT License.
Credits
This RDP algorithm implementation is heavily influenced by Marius Karthaus's JavaScript implementation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
curvereduce-1.0.0.tar.gz
(16.0 kB
view hashes)
Built Distribution
Close
Hashes for curvereduce-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bcc3ad11fe717ba01b456f3a1258aa7accd6e3dabb9355f9d085567559cee58 |
|
MD5 | c4a0986e5a4957b94bca1c897162d2b4 |
|
BLAKE2b-256 | a4bc75c4d22ac91cde7bb87d15cc72d2aa5127038abbc2efd76cf3ee31de880d |