Skip to main content

Curve simplification per Ramer-Douglas-Peucker.

Project description

curvereduce

This is an implementation of the Ramer-Douglas-Peucker curve simplification algorithm in Python.

codecov

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


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)

Uploaded Source

Built Distribution

curvereduce-1.0.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

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