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.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86b53799f57f991457034611d454ca8936073d04634ca28050b56191f4d777e5 |
|
MD5 | 09f535b6d52eaa0a43ee8cfe17b0e1e0 |
|
BLAKE2b-256 | d02e3acca3328425b48037f019b1194857ac234a179736af8c4d214c06211ede |
Hashes for curved-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85d864c9ff5a02ad8130a37c6f2619ecb3a53b768a69d1084021ee919fab43e0 |
|
MD5 | c0cc0d933c152e8e6505fe95578e9164 |
|
BLAKE2b-256 | 65f3cf6b6ee6a763c2dbf0fe5292b75e0ff86f61accf2a50f802c3b2f203d203 |
Hashes for curved-0.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5319e78022e8f2b58b7c60185ea3c507fcdcee364b176b84705e6dc53e369450 |
|
MD5 | 3ba3562520e5fb0ee13aa5d08d27e1f8 |
|
BLAKE2b-256 | b94ff2e7771ea326f859aae569517c641febb66f7c5e107c02d1874e02f43344 |
Hashes for curved-0.1.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3170db759ea0c3798694124812f816f3b8f8f90c172e8aeab5ddba2dd9f818b |
|
MD5 | 11dce3301e9ff32bc3907c3a57133a6f |
|
BLAKE2b-256 | 5087bcd8a9d57e2ab3c03a5110e7b257ac6672edf55659dfb727f0b96db7b2d9 |