Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.7s · import 0.335s · 88MB
89MB installed
● package 89MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
simplify_coords
✓ from simplification.cutil import simplify_coords
Primary function for Ramer-Douglas-Peucker simplification.
simplify_coords_vw
✓ from simplification.cutil import simplify_coords_vw
Primary function for Visvalingam-Whyatt simplification.
simplify_coords_vwp
✓ from simplification.cutil import simplify_coords_vwp
Topology-preserving variant of Visvalingam-Whyatt, which is slower but more likely to produce valid geometries.
This quickstart demonstrates how to simplify a linestring using both the Ramer-Douglas-Peucker (RDP) and Visvalingam-Whyatt (VW) algorithms. It showcases usage with both standard Python lists of coordinates and NumPy arrays, which are efficiently handled by the underlying Rust implementation. For RDP, `epsilon` defines the tolerance, while for VW, `threshold` represents a minimum effective area.
import numpy as np
from simplification.cutil import simplify_coords, simplify_coords_vw
# Example coordinates (list of lists or NumPy array)
coords_list = [
[0.0, 0.0],
[5.0, 4.0],
[11.0, 5.5],
[17.3, 3.2],
[27.8, 0.1]
]
coords_np = np.array(coords_list)
# --- Ramer-Douglas-Peucker (RDP) Simplification ---
# Epsilon: maximum distance between an original point and the simplified line segment
epsilon_rdp = 1.0
simplified_rdp = simplify_coords(coords_list, epsilon_rdp)
print(f"RDP Simplified (epsilon={epsilon_rdp}): {simplified_rdp}")
# --- Visvalingam-Whyatt (VW) Simplification ---
# Threshold: minimum effective area of a triangle formed by a point and its neighbors
threshold_vw = 30.0
simplified_vw = simplify_coords_vw(coords_np, threshold_vw)
print(f"VW Simplified (threshold={threshold_vw}): {simplified_vw}")
Debug
Known issues
gotchaThe library primarily exposes functions through `simplification.cutil`, which is a Cython/Rust FFI module. Direct imports from `simplification` (e.g., `from simplification import simplify`) will fail as the main simplification functions are not exposed at the top-level package.fixAlways import specific simplification functions from `simplification.cutil`, e.g., `from simplification.cutil import simplify_coords`.
affects: All versions
gotchaThe library's documentation explicitly states that 'Error-checking is non-existent at this point.' This means invalid inputs (e.g., non-numeric coordinates, malformed lists) might lead to crashes or unexpected behavior rather than clear Python exceptions.fixThoroughly validate input data (coordinate types and structure) before passing it to simplification functions to prevent runtime errors.
affects: All versions (v0.7.14 and earlier)
gotchaWhen using Visvalingam-Whyatt, the `simplify_coords_vwp` function offers a topology-preserving variant. While it produces geometries less prone to self-intersections, it is generally slower than `simplify_coords_vw`. Choose based on your application's need for speed versus geometric validity.fixUnderstand the trade-offs: use `simplify_coords_vw` for maximum speed if topological correctness is secondary; use `simplify_coords_vwp` when preserving topology is critical, accepting a performance cost.
affects: All versions
gotchaThe `simplification` library relies on a compiled Rust binary. While `pip install` typically handles pre-built wheels, local development or unusual environments might require a Rust toolchain for compilation, which can be a dependency hurdle.fixFor local development from source, ensure Rust (cargo) is installed. If encountering installation issues in constrained environments, verify that pre-built wheels are available for your platform and Python version, or prepare to compile from source.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'simplification.cutil'
The `simplification` library's core functions are implemented in Rust and exposed via a `cutil` module. This error usually means the C/Rust extension module failed to compile or was not properly installed.
fixEnsure `pip install simplification` completes without errors. If installing in a non-standard environment or from source, you may need a Rust toolchain installed (e.g., `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`) and potentially development headers for Python.
AttributeError: module 'simplification' has no attribute 'simplify_coords'
Attempting to import simplification functions directly from the top-level `simplification` package instead of its `cutil` submodule.
fixCorrect the import statement to specifically target `simplification.cutil`: `from simplification.cutil import simplify_coords` (or other relevant functions).
ValueError: input is not a valid sequence of coordinates
The input `coords` argument to `simplify_coords` or `simplify_coords_vw` is not in the expected format (e.g., not a list of lists/tuples of numbers, or a 2D NumPy array).
fixEnsure your input coordinates are a sequence of sequences (e.g., `[[x1, y1], [x2, y2]]`) or a 2D NumPy array with shape `(N, 2)` or `(N, 3)` where N is the number of points and 2/3 are the dimensions.
Upgrade
Version history
1.0.0latest on PyPI · released Jun 8, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.10 or newer.
numpyoptionalHighly recommended for efficient input/output of coordinate arrays.