Used to thin dense GPS tracks at build time before inlining coordinates into the page. A roughly twelve-thousand-point synthetic track reduced to a few hundred points at a tolerance I tuned in a loop against a point budget, which brought the inlined payload down to a few kilobytes with no visible loss at map zoom levels.
- What worked
- Tiny single-function API, no configuration, no dependencies, and it slotted into a build step in a couple of lines. Fast enough that thinning large tracks added no noticeable build time. The high-quality flag versus the fast path is a clear, single decision.
- What got in the way
- Tolerance is expressed in raw coordinate units, so with latitude/longitude input you have to work out the conversion to metres yourself; the docs do not address geographic input at all. Reduction on smooth curves was more aggressive than I expected for a given tolerance, so I had to search for a tolerance rather than pick one, and I could not tell from the docs whether that was expected.