Skip to main content

Fast linestring simplification using RDP or Visvalingam-Whyatt and a Rust binary

Project description

Line

Simplify a LineString using the Ramer–Douglas–Peucker or Visvalingam–Whyatt algorithms

Installation

pip install simplification

Please use a recent (>= 8.1.2) version of pip

Supported Python Versions

  • Python 2.7

  • Python 3.4

  • Python 3.5

  • Python 3.6

Supported Platforms

  • Linux (manylinux1-compatible)

  • OS X

  • Windows 32-bit / 64-bit

Usage

import numpy as np
from simplification.cutil import simplify_coords, simplify_coordsvw

coords = [
    [0.0, 0.0],
    [5.0, 4.0],
    [11.0, 5.5],
    [17.3, 3.2],
    [27.8, 0.1]
]

# For RDP, Try an epsilon of 1.0 to start with. Other sensible values include 0.01, 0.001
simplified = simplify_coords(coords, 1.0)

# simplified is [[0.0, 0.0], [5.0, 4.0], [11.0, 5.5], [27.8, 0.1]]

# Using Visvalingam-Whyatt
# we can also pass numpy arrays, in which case numpy arrays are returned
coords_vw = np.array([
    [5.0, 2.0],
    [3.0, 8.0],
    [6.0, 20.0],
    [7.0, 25.0],
    [10.0, 10.0]
])
simplified_vw = simplify_coords_vw(coords, 30.0)

# simplified_vw is [[5.0, 2.0], [7.0, 25.0], [10.0, 10.0]]

How it Works

FFI and a Rust binary

Is It Fast

I should think so.

License

MIT

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

simplification-0.3.2-cp36-cp36m-manylinux1_x86_64.whl (468.0 kB view details)

Uploaded CPython 3.6m

simplification-0.3.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.whl (314.1 kB view details)

Uploaded CPython 3.6mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.11+ Intel (x86-64, i386)macOS 10.11+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

simplification-0.3.2-cp35-cp35m-win_amd64.whl (280.6 kB view details)

Uploaded CPython 3.5mWindows x86-64

simplification-0.3.2-cp35-cp35m-win32.whl (262.0 kB view details)

Uploaded CPython 3.5mWindows x86

simplification-0.3.2-cp34-cp34m-manylinux1_x86_64.whl (469.2 kB view details)

Uploaded CPython 3.4m

simplification-0.3.2-cp27-cp27mu-manylinux1_x86_64.whl (446.4 kB view details)

Uploaded CPython 2.7mu

simplification-0.3.2-cp27-cp27m-win_amd64.whl (279.8 kB view details)

Uploaded CPython 2.7mWindows x86-64

simplification-0.3.2-cp27-cp27m-win32.whl (262.9 kB view details)

Uploaded CPython 2.7mWindows x86

simplification-0.3.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.whl (321.2 kB view details)

Uploaded CPython 2.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.11+ Intel (x86-64, i386)macOS 10.11+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

Details for the file simplification-0.3.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 844a78313f4ee0d4dc93481fd4951e752e3a0049223cf64dce539c4467db141b
MD5 5f745cab5c7b9448e7c152a0a8cbb1ea
BLAKE2b-256 8bc60efbb1941debec9b16398e01a09d97b15926ba8662ee86f1023ac7f6f09f

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 e625358161ea6cf46625dc8a75d23301ea7ff6e345ce05c2f305f29e5d69972e
MD5 020d44284199cedd59db40eec08e0cbb
BLAKE2b-256 638917e7d7535b10292c9db426c9e02c4e400143f0848202246f9b171effd60a

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 ab890d89d571ec95deb6b96e2ea02e6fb9e65b80862349ba033756b74eed12b6
MD5 dc3d08913d74988f7e772fd4412f3eb5
BLAKE2b-256 9ae445f6866143b5a6748184fafe56427b561d8754e052813de74a3315cb1505

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 cd218aa2d4282ffdb8ea29ce2df1dd9c8f58466ef7cec7dde62af8d02f8e8791
MD5 2cf01cf97a90d8cd4b62ab34e1f025a7
BLAKE2b-256 b12236eea01b4e890e4cc9938a9cebf654726665236008369fb3418715e9bc9d

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3366080f3a66525bc718ddc0b0ff6678349cff9594d6e26a3fec2e344be56a08
MD5 2eb0a9f6810ad64820b3dc0105032296
BLAKE2b-256 1e9e41920951db06440e4512e92ae3f217b62baa4bf547224c4dbc8f21d8f38d

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d608016e02100e66df1a64b09995e6b5900cd75975d49ffa20d402cac688f82e
MD5 96046dacdd881f90a085b326af622d5a
BLAKE2b-256 0be07ef7966a76aa03a8bca2124db6e143d10f73f1913def706179ff738d7c98

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 f45962a3bcaccbedaa23fe80c30bd09ff7753f38a476c433778f058594f1c6ee
MD5 dfc7033120701c881926e23a853322bd
BLAKE2b-256 29b74083a31a587681b0fea7c43ab6acbdc9ec612ba2b61f2491034b0b4c7204

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 74e1095808829ad378d07630e235d71de8a6d388e2d80a1d5e00e6e0f35c5a03
MD5 9dfa6e17e78ea180260d95b1306486f1
BLAKE2b-256 57812b41cc13c283891202066b7c840d60080265def77a99955a203a6083645d

See more details on using hashes here.

File details

Details for the file simplification-0.3.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for simplification-0.3.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.macosx_10_11_intel.macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 1eecbacc39d2d44033643f3560807b43fc1b2f2a2ae5f5b47b326a136521026a
MD5 0979ac8812d90a5618ee976252964aa6
BLAKE2b-256 e13f4c44c7c52cd04cef1e27a7ca1c0f469fe3274b99f5a98e14efaf5d311881

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page