Skip to main content

Simplify 2D and 3D Lines

Project description

Simplify 2D and 3D Lines

PyPI Run Tests Docs License

A high performance 2D and 3D line simplification algorithm. Uses Ramer-Douglas-Peucker Line Simplification.

Key Features

  • Simplify 2D and 3D lines
  • Written in C++ with python bindings. Can be used standalone in a C++ project with CMake as well.
  • Based on high-performance Simplify.js

Install with Python and Use

The python library can be installed as so:

  1. pip install simplifyline

Example Use:

from simplifyline import simplify_line_2d, MatrixDouble 
mat2D = MatrixDouble([[0.0, 0.0], [1.0, 1.0], [2.0, 2.0], [3.0, 3.0]])
results_mat2D = simplify_line_2d(mat2D, max_distance=0.1, high_quality=True)
results = np.array(results_mat2D)
np.testing.assert_array_equal(results, np.array([[0.0, 0.0], [3.0, 3.0]]))

See documentation for more details.

Build Project Manually

You can build the project manually in two ways: using python setup.py, or in pure CMake

Build Manually with Python

The root directory setup.py file has been modified to build with CMake. This is meant for python users that need to build manually (for some reason) but are not actively developing or changing the code.

  1. Install conda or create a python virtual environment (Why?). I recommend conda for Windows users.
  2. pip install . - Call from root directory

Build Manually With CMake

Building happens entirely with CMake. This is meant really only for the library developers who are working on C++ and Python in an edit-compile cycle.

C++ Library

  1. mkdir cmake-build && cd cmake-build
  2. cmake .. - Note - For windows also add -DCMAKE_GENERATOR_PLATFORM=x64
  3. cmake --build . -j$(nproc) --config Release

Build options:

SPL_BUILD_BENCHMARKS:BOOL=ON // SPL - Build Benchmarks
SPL_BUILD_EXAMPLES:BOOL=ON // SPL - Build Examples
SPL_BUILD_PYMODULE:BOOL=ON // SPL -Build Python Module
SPL_BUILD_TESTS:BOOL=ON // SPL - Build Tests
SPL_BUILD_WERROR:BOOL=OFF // SPL - Add Werror flag to build (turns warnings into errors)
SPL_WITH_OPENMP:BOOL=ON // SPL - Build with OpenMP Support

Python Extension

This is meant for advanced python users who are actively developing the extension.

  1. Install conda or create a python virtual environment (Why?). I recommend conda for Windows users.
  2. Perform CMake build as described above
  3. cd cmake-build && cmake --build . --target python-package --config Release
  4. cd lib/python_package && pip install -e . . This installs the library in develop/edit mode. To update the python extension in your python virtual environment all you need to do is run step 3 again.

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

simplifyline-0.0.7.tar.gz (28.8 kB view details)

Uploaded Source

Built Distributions

simplifyline-0.0.7-cp39-cp39-win_amd64.whl (151.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

simplifyline-0.0.7-cp39-cp39-manylinux2010_x86_64.whl (243.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

simplifyline-0.0.7-cp38-cp38-win_amd64.whl (151.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

simplifyline-0.0.7-cp38-cp38-manylinux2010_x86_64.whl (243.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

simplifyline-0.0.7-cp37-cp37m-win_amd64.whl (152.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

simplifyline-0.0.7-cp37-cp37m-manylinux2010_x86_64.whl (243.8 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

simplifyline-0.0.7-cp36-cp36m-win_amd64.whl (151.7 kB view details)

Uploaded CPython 3.6m Windows x86-64

simplifyline-0.0.7-cp36-cp36m-manylinux2010_x86_64.whl (243.9 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

File details

Details for the file simplifyline-0.0.7.tar.gz.

File metadata

  • Download URL: simplifyline-0.0.7.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7.tar.gz
Algorithm Hash digest
SHA256 bb56f5781cb8aec414e617e83c4e341be344df905a75cfb4ccf4119af87bde17
MD5 fbea9c90566ed10c2d71210b886b52ad
BLAKE2b-256 fd3848aa69ebcefd87453c24ee21f4a6a907d034cc239369651de91b9fbae119

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 151.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ee8ab3bb0b633fd684fc4c9a930c30a25fb13d45ff4c80ca3ce7ce1146e3a302
MD5 53c7e9386aacc433a18dcee8fc5b754d
BLAKE2b-256 862bf24d548fc8870272ac45575db06070b360edb840d2ef9514e82c27ee0401

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 243.9 kB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 34b9648db0838b9dd326de69760410303589daceae28e02961d4cba9106a624b
MD5 d5b16fc38e237207331d57b7ba1b01bf
BLAKE2b-256 7034ac9101d9ce50dbe79e61f2afe7062c18464dcfdb0c50afb4e874b5f71291

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 151.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c78626db0e74ed257b8e6e8af06921574cf8095857c4d966057777694ab4384b
MD5 af4f2883eb1dc56ac7892e4a6a47a59f
BLAKE2b-256 ca34708db46ab0453323e2f2c221dace2439d69c74fc190c44b68f381b958bf3

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 243.8 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 6fc78c87b147073b9aa9d0ed2635afaa1a9cb50af1039abdce04efdab68646c9
MD5 41f2a378f82e504283770ed340f8abd8
BLAKE2b-256 31f177376708a9e322d3abc5119165d13233aef81304d14280b1ffb7320a55a5

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 152.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6558657b9ffad101e47363a91d1a20693af4dee7b410c645e6b3b2b343c590bf
MD5 4eca8cc1af0ac95d74b207237e7226b5
BLAKE2b-256 bc7a149b2fbd21cf849f7c3a0914bfb945347b01ef0ae77951ed333cccf14854

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 243.8 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ba9b9b25c12edd20706a1ca683d63fe9e6fcd468516066bae0172e0e333c000b
MD5 9021280f65c1df5c5c1507cc755096ef
BLAKE2b-256 3c8e2790d3b3560604100d23f031883f5eeed49637847435a7b4977a5f194f80

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 151.7 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 38cb8b4abcda99f6d8fa201d5c544678c4f717b25f9918ecb87c5edc006d347d
MD5 f09d265a0f59f5226d8b7158e3b7190e
BLAKE2b-256 d7d77a0711f1e5ebd1d38923f0e2686b66b8e97474da83270342d15164ce50ae

See more details on using hashes here.

File details

Details for the file simplifyline-0.0.7-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: simplifyline-0.0.7-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 243.9 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for simplifyline-0.0.7-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2aa4cc1c53f313a01170e591a8c88e04b432b34f41a005ca8e96c924200fd9c5
MD5 fadcfca6e3e2e59994442582df63ced6
BLAKE2b-256 30bb23e094d6c197fab74a2df38e5435888488b0cc9d2dd97c3e675fc0431395

See more details on using hashes here.

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