You are here

Simplify your polyline but keep its form

Blog Terms: 

If you need add a polyline or polygon to draw a country/state shape in Google Map/OSM, maybe you will get performence problem because of the huge collection of points in your polyline.
Then you need this javascript library: Simplify.js

Simplify.js (License: BSD, GitHub: mourner / simplify-js, npm: simplify-js) is a tiny high-performance JavaScript 2D/3D polyline simplification library by Vladimir Agafonkin, extracted fromLeaflet, a JS interactive maps library of the same author. It uses a combination of Douglas-Peuckerand Radial Distance algorithms. Works both on browser and server platforms.