a high performance Python module for curve simplification
Project description
Curved
Curved is a Python module written in Rust that performs curve simplification. It has been heavily optimised, and currently performs better than the simplification algorithm in Shapely. At the moment, only the Ramer-Douglas-Peucker algorithm has been implemented.
The simplification is not limited to 2D shapes, unlike traditional implementations. It is possible to simplify the points of an N dimensional shape.
Installation
Source, and limited binary packages are provided on PyPI. These can be installed via a simple pip install curved
. Note, if installing from a source package, make sure you have a suitable Rust build environment available.
Usage
import numpy as np
import curved
# Let's simplify a 1000 point circle down to just 33 points
t = np.linspace(0, 2 * np.pi, 1000)
points = np.vstack((np.cos(t), np.sin(t))).T
mask = curved.rdp(points, 0.01)
simplified = points[mask]
Contributions
Contributions are welcome. Please feel free to create issues for bugs or feature requests. If you have code to contribute, feel free to open a pull request.
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
Built Distributions
Hashes for curved-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f506393ea6919a4906adb921a822095ef2744cb08f4bb3a9276446a0194a3cda |
|
MD5 | 841873e20645384ffaded6777565208f |
|
BLAKE2b-256 | 0f33266328b259827f60913b6c3ba3a363bec6c53a068528e467b25aa266f0b0 |
Hashes for curved-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb59904a46b4ce7206b8cbcb8510e9dd514005bc00b0ee7104a80dccf274f687 |
|
MD5 | 1f315dc438e4c4efa97e5be20b1870ba |
|
BLAKE2b-256 | 062abecc99c0aed7b5f4f05d8e850023ac8ed4ae7befa00ca2e934ac70b314e4 |
Hashes for curved-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eda162a083d9425231e5c5a778f96de8aa3460fd36a9befa280b1d54f2dcc05 |
|
MD5 | 5939de8389f21f8bac7650d6cd0e920d |
|
BLAKE2b-256 | b1c01a21906ef27bf3195824fb4bbcf5ed7e3634c3e803d25d76f0fbee584eff |
Hashes for curved-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d5756712caf748595fa66f1de9ef5a2c5f88d94263f7416b49cf4d19f15f350 |
|
MD5 | 9df30abef93418e9fc90b44463d0715f |
|
BLAKE2b-256 | 39c29013b5538564d2fc5848f3c2c61fbb16ab90abc9934d746d900e76b16848 |
Hashes for curved-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fb66404675432e666dbea5db309af54f2d7f07a4c261ed01b86f3fb30d86fd7 |
|
MD5 | 7a3880028c48f730678ced664d7cdc92 |
|
BLAKE2b-256 | c64dd571b499e559ecd1d6f412d02526b05ee9e92e2654c981827085ae4851e6 |
Hashes for curved-0.1.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed69fb2d15f3e95ebde0424ad84e9b8954618931a502c6b97281d1616d601eae |
|
MD5 | c8426c3eb535927f433bf65a14420536 |
|
BLAKE2b-256 | a836949b4a949d9521bbf906da2c2b5c10d273369b1d1d67a44003dbc21f9cf9 |