Skip to main content

Build Status Coverage Status Downloads DOI Anaconda-Server Badge

Simplification

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

Line

Installation

uv add simplification OR
pip install simplification OR
conda install conda-forge::simplification

Installing for local development

  1. Ensure you have a copy of librdp and header.h from https://github.com/urschrei/rdp/releases, and it's in the src/simplification subdir
  2. run uv sync --dev
  3. run pytest .

Changes in pyx and pxd files, and the Rust library and header will bust the cache, triggering a rebuild when uv commands are run.

Building SDist and Wheels

  1. Ensure that librdp and header are present, as above
  2. Run uv build --sdist --wheel

Supported Python Versions

Simplification supports all currently supported Python versions.

Binary wheels target the CPython Stable ABI (abi3): a single abi3 wheel per platform covers CPython 3.11 and later, while CPython 3.10 receives a standard version-specific wheel.

Supported Platforms

  • Linux (manylinux-compatible) x86_64 and aarch64
  • macOS Darwin x86_64 and arm64
  • Windows 64-bit

Usage

from simplification.cutil import (
    simplify_coords,
    simplify_coords_idx,
    simplify_coords_vw,
    simplify_coords_vw_idx,
    simplify_coords_vwp,
)

# Using Ramer–Douglas–Peucker
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
# You can also pass numpy arrays, in which case you'll get numpy arrays back
import numpy as np
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_vw, 30.0)

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

Passing empty and/or 1-element lists will return them unaltered.

But I only want the simplified Indices

simplification now has:

  • cutil.simplify_coords_idx
  • cutil.simplify_coords_vw_idx

The values returned by these functions are the retained indices. In order to use them as e.g. a masked array in Numpy, something like the following will work:

import numpy as np
from simplification.cutil import simplify_coords_idx

# assume an array of coordinates: orig
simplified = simplify_coords_idx(orig, 1.0)
# build new geometry using only retained coordinates
orig_simplified = orig[simplified]

But I need to ensure that the resulting geometries are valid

You can use the topology-preserving variant of VW for this: simplify_coords_vwp. It's slower, but has a far greater likelihood of producing a valid geometry.

But I Want to Simplify Polylines

No problem; Decode them to LineStrings first.

# pip install pypolyline before you do this
from pypolyline.cutil import decode_polyline
# an iterable of Google-encoded Polylines, so precision is 5. For OSRM &c., it's 6
decoded = (decode_polyline(line, 5) for line in polylines)
simplified = [simplify_coords(line, 1.0) for line in decoded]

How it Works

FFI and a Rust binary

Is It Fast

I should think so.

What does that mean

Using numpy arrays for input and output, the library can be reasonably expected to process around 2500 1000-point LineStrings per second on a Core i7 or equivalent, for a 98%+ reduction in size.
A larger LineString, containing 200k+ points can be reduced to around 3k points (98.5%+) in around 50ms using RDP.

This is based on a test harness available here.

Disclaimer

All benchmarks are subjective, and pathological input will greatly increase processing time. Error-checking is non-existent at this point.

License

Blue Oak Model Licence 1.0.0

Citing Simplification

If Simplification has been significant in your research, and you would like to acknowledge the project in your academic publication, we suggest citing it as follows (example in APA style, 7th edition):

Hügel, S. (2021). Simplification (Version X.Y.Z) [Computer software]. https://doi.org/10.5281/zenodo.5774852

In Bibtex format:

@software{Hugel_Simplification_2021,
author = {Hügel, Stephan},
doi = {10.5281/zenodo.5774852},
license = {MIT},
month = {12},
title = {{Simplification}},
url = {https://github.com/urschrei/simplification},
version = {X.Y.Z},
year = {2021}
}

Metadata

Release files for simplification 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplification 1.0.0
File Size Uploaded
simplification-1.0.0.tar.gz 1.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for simplification 1.0.0
File
simplification-1.0.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
simplification-1.0.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
simplification-1.0.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
simplification-1.0.0-cp311-abi3-macosx_11_0_x86_64.whl CPython 3.11 abi3 macOS 11.0+ x86-64 Details
simplification-1.0.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
simplification-1.0.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
simplification-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
simplification-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64 Details
simplification-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 11.0+ x86-64 Details
simplification-1.0.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 4.3 MB

Release files / simplification-1.0.0.tar.gz

Download URL simplification-1.0.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
c1e33379455f5da02462b2d674b816a5f385bbbde216652101465fd33e4a2e3c
BLAKE2b-256 checksum
How to use checksums
ede4acaf8400d85ced98c4a371818fcde69c202fdbd3942666e374989cb370be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp311-abi3-win_amd64.whl

Download URL simplification-1.0.0-cp311-abi3-win_amd64.whl
Size 333.4 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e114c5feaa44fa6272dbf2a455f901b9c6196fb653b45652db0741c0770fe154
BLAKE2b-256 checksum
How to use checksums
2f6708db7eabb5f2fb74702ec5b478a0c206177d68d9875a7b13c3b8bbda15b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL simplification-1.0.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 290.1 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
e533dd74ee873728de1eda7a456c2ebd021243137c59c5c674e5d9665b930d22
BLAKE2b-256 checksum
How to use checksums
691c083b6a0d5909741620581f6730f23357ca308bc6fb33823d35b9be9587cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL simplification-1.0.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 274.5 kB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
249ec6b7bbf2baed3655246dde003a9607ae7cb182e7c7053ada52c01ceef808
BLAKE2b-256 checksum
How to use checksums
097a55f40b9a903bf45ac24da8bb4f2fbc3419c80462e6c43dd6b5713d53383c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp311-abi3-macosx_11_0_x86_64.whl

Download URL simplification-1.0.0-cp311-abi3-macosx_11_0_x86_64.whl
Size 261.1 kB
Tags CPython 3.11 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
4e0fa16ea12cdce014d0cf649a36bf91733bddbfab8e6fd7bab7251bbd5c28f1
BLAKE2b-256 checksum
How to use checksums
f42eb0a647c7757b432dbc2a5b84ae49c8e01a8a78380442d3d67b1352e2f141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL simplification-1.0.0-cp311-abi3-macosx_11_0_arm64.whl
Size 243.2 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8def6393614096bfcb69e889f0da371a58009de8fc3d6660e31dfda3d0f35e61
BLAKE2b-256 checksum
How to use checksums
54a438cfcf4d209748ad543b8fde594f66513227fb74b0840cceba0192ef3ded
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp310-cp310-win_amd64.whl

Download URL simplification-1.0.0-cp310-cp310-win_amd64.whl
Size 341.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
07f59a2497caa598cf2b9788d07c4dc4451741dc4516caf3678307947eb64d75
BLAKE2b-256 checksum
How to use checksums
f1418c87aed926a38f0d76403a0127c087942b85fbb71f72fcd84844b353f974
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL simplification-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 299.5 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
28f3217807ff37484d7f8a9a31dd49ea6b767198af3f147b72627dd6101b2c1d
BLAKE2b-256 checksum
How to use checksums
dc0e96186c48fcf1ca4759a49df80d7e3c720f0e008d4cd3fab003319ea10ec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl

Download URL simplification-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl
Size 283.6 kB
Tags CPython 3.10 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
475d31233860a9e583a07697bc09857ce8baf28a82a58adcb35f51ae9ec24de4
BLAKE2b-256 checksum
How to use checksums
19523cdb0b78eebf7409744daa3b79fc08bd5e2a63b85e80227a67b44e91cb9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl

Download URL simplification-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl
Size 269.8 kB
Tags CPython 3.10 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
b7ab0bc7b00a89cbb03fa2940ddbe9d20e1e51830989efe9a45453a76d72d330
BLAKE2b-256 checksum
How to use checksums
658115e3ff65c77998720cab86324d3282cb7c8ade14b1a9a969e6667a61b61e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release files / simplification-1.0.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL simplification-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Size 251.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a828ebd3d1f086fd8219f09f01cc979e947994cd473901a48ba5eb922e0d23ec
BLAKE2b-256 checksum
How to use checksums
f6e94862674a2e8aa98265e18a75af9bde4796fb67905ca80dd1d0dafdb5c6cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

11 release files

0.7.0

21 release files

0.6.7

25 release files

0.6.6

25 release files

0.6.4

24 release files

0.6.2

19 release files

0.6.1

15 release files

0.6.0

11 release files

0.5.14

8 release files

0.5.7

12 release files

0.5.1

18 release files

0.4.4

18 release files

0.4.2

14 release files

0.3.8

16 release files

0.3.7

14 release files

0.3.3

9 release files

0.3.2

9 release files

0.2.9

14 release files

0.2.8

13 release files

0.2.7

12 release files

0.2.2

7 release files

0.2.1

7 release files

0.1.6

7 release files

0.1.2

7 release files

0.1.1

7 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page