A test project using pybind11 and CMake
Project description
Ramer-Douglas-Peucker Algorithm (c++ binding for python via pybind11)
A speed up version of python version of rdp.
C++/pybind11/NumPy implementation of the Ramer-Douglas-Peucker algorithm (Ramer 1972; Douglas and Peucker 1973) for 2D and 3D data.
The Ramer-Douglas-Peucker algorithm is an algorithm for reducing the number of points in a curve that is approximated by a series of points.
Installation
via pip
pip install pybind11-rdp
from source
pip install git+https://github.com/cubao/pybind11-rdp.git
Or
git clone --recursive https://github.com/cubao/pybind11-rdp
pip install ./pybind11-rdp
Usage
Simple pythonic interface:
from rdp import rdp
rdp([[1, 1], [2, 2], [3, 3], [4, 4]])
[[1, 1], [4, 4]]
With epsilon=0.5:
rdp([[1, 1], [1, 1.1], [2, 2]], epsilon=0.5)
[[1.0, 1.0], [2.0, 2.0]]
Numpy interface:
import numpy as np
from rdp import rdp
rdp(np.array([1, 1, 2, 2, 3, 3, 4, 4]).reshape(4, 2))
array([[1, 1],
[4, 4]])
Links
References
Douglas, David H, and Thomas K Peucker. 1973. “Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or Its Caricature.” Cartographica: The International Journal for Geographic Information and Geovisualization 10 (2): 112–122.
Ramer, Urs. 1972. “An Iterative Procedure for the Polygonal Approximation of Plane Curves.” Computer Graphics and Image Processing 1 (3): 244–256.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pybind11_rdp-0.0.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fae9583e0da01f900277b7c0fad22da5c174491a05710d96f2ed495fbdcc7bf |
|
MD5 | b919f7fc602393a2750154c33d9c362f |
|
BLAKE2b-256 | 7a9bc79eb010e4fe3b3f9528c455f9a1dcf3cd1a991ac7501883414ee04e71e0 |
Hashes for pybind11_rdp-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0705217bbd89d282b24bf86768af8b1e61fce9579b5ad17d741dca48d1e37800 |
|
MD5 | af4ada7b1e925d74b2dcf9a9fde56a9b |
|
BLAKE2b-256 | 44ac95d6670e46526580b572e98dc8fb078eafc9801557fe6d02848b8540bfe6 |
Hashes for pybind11_rdp-0.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f15326a9b6acd91516a6af6f0c73aa5e6772fc038f6157ef0f6de13fa9f97664 |
|
MD5 | 0870989a6297a6f144c54ca2abfd4432 |
|
BLAKE2b-256 | 382e3223cb7917cd74b1dbf9cc94d1514c271c30b2db86bcbd8b375e220c62ec |
Hashes for pybind11_rdp-0.0.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fa0cb98a8b0497fafbbfb5dc0d6735a9a92d62ba9d0a88cc8c92d9f61ffe618 |
|
MD5 | 76d4733f4270ef9959503a76e9ce469e |
|
BLAKE2b-256 | 760701aa2ae1c08c8bbb912a207b739e3789835187f2a58ff1b2702818bce892 |
Hashes for pybind11_rdp-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3d952ce10eb25a604c067f992627b5a423cf4410acef0241e606785e54c99e4 |
|
MD5 | 942fb99ce7da57f636e889a744119a1c |
|
BLAKE2b-256 | c15a5b3cea20141453590831c7a16ae313956c10e99d6075f190476f5f492a18 |
Hashes for pybind11_rdp-0.0.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36aaecc588b68518fb0ebf857c56283f1809f624162d4d6cca1d006302821adc |
|
MD5 | d93c456315ddd520b84d8bc2ab76ff3c |
|
BLAKE2b-256 | b0ad2dac54e395bb0c8be8f3f0ff3843cb47e80baaa20578a1ec29974b5a4392 |
Hashes for pybind11_rdp-0.0.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 956ef73cce7e47889b813e0aa4f59f40191ead092cb1c4ea042964d3bdf2344a |
|
MD5 | a2e09a83bf9ae187553456ea4aa71396 |
|
BLAKE2b-256 | 80aef818cd9f58a63829e24dd0aa80488017d0ae7a1ac5b221893d8b1d0004f3 |
Hashes for pybind11_rdp-0.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f32b589b034bb6efbfc3f1a2bb60f1e56a6d538f4c02eddee1340d003e0ac67a |
|
MD5 | 6863679d25aa2cb180f6a94b72a872f4 |
|
BLAKE2b-256 | 4e07dfcc1fcfc35d22c3b4c4836e9d3697a1c1e7f0f1ac4438adea9c9c26c8b9 |
Hashes for pybind11_rdp-0.0.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb67ce41c226ae5c5816c10d003528a37fedd64800f10fc8971ee70360a47cd7 |
|
MD5 | feb5c53da4127d63033891a57f7ab723 |
|
BLAKE2b-256 | 2a4b9b577da6603895635c576a2df11fcf466039c5d0d7cfe34ed32ec3ccebff |
Hashes for pybind11_rdp-0.0.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eec10dc678e3d10decd83942b5f49aca86ae569d356b598ccd9a3085084bfb7 |
|
MD5 | 528019af3bb842b0df398a7c018137a9 |
|
BLAKE2b-256 | 2b0bbebfd09870da5218c4a6becd9773a37a0843a359b9af62b02d23e1e1422b |
Hashes for pybind11_rdp-0.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70d067fd5fdcb95876d1b204322cc0b61438e07ffcbf85c9c03c4629f069a80c |
|
MD5 | 98b7f48dcc33aa84a119e145e07f0f76 |
|
BLAKE2b-256 | edd769d167ac15a1e9c61a19158765c0235ff798f9ab5c98293d93f840cb2361 |
Hashes for pybind11_rdp-0.0.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4ae33d11c2d6da4d4a262840b0af8c18f82864367ced87aa01239f5970a3181 |
|
MD5 | eaf0dfa63b5673916f4cbad310721640 |
|
BLAKE2b-256 | 084d9c859c90ac573e11e6aa9f3f7d153379ad5fddb0c6a5b68ea2effcfaadce |
Hashes for pybind11_rdp-0.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26927688d4ebdff4a6a2a8b4a00406da1f6bacab3e0fbf3e982d4429c9226541 |
|
MD5 | c0768e711286b3ab9b86b5e783115f47 |
|
BLAKE2b-256 | d0f32e20f1eef968f68049f9657d90f9d2bd4ac932150d317f2d3c8f66c16d60 |