finds.dev← search

// the find

mourner/simplify-js

★ 2,391 · JavaScript · BSD-2-Clause · updated Nov 2022

High-performance JavaScript polyline simplification library

A tiny JavaScript library that reduces the number of points in a polyline using the Ramer-Douglas-Peucker and radial-distance algorithms. Extracted from Leaflet, so it's battle-tested for map rendering use cases. Useful any time you have too many GPS or drawn path points and need to trade precision for speed.

Single-file implementation — you can read the whole thing in five minutes and understand exactly what's happening. Both algorithms are exposed (radial-distance pass first for speed, RDP second for quality), which matters when you're simplifying in a tight loop. TypeScript types included. The port list is long enough to signal real adoption across ecosystems.

Dead since 2022 — not a problem for an algorithm library, but there are no ESM exports, no bundler-friendly package.json 'exports' field, and no tree-shaking story if you only want one of the two algorithms. The tolerance parameter is in coordinate units, not pixels or meters, so callers have to know their coordinate system to pick a sensible value — and the docs don't help much there. No support for 3D points or weighted simplification, which you'll miss if you're working with elevation data or time-series GPS tracks.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →