Phrogz / svg2geojson

Converts an SVG file with added geo-referencing tags into one or more GeoJSON files.
MIT License
57 stars 30 forks source link

pruning polylines #15

Open helgasoft opened 2 years ago

helgasoft commented 2 years ago

Thank you for the very useful package, works great! I noticed however that the output geoJson file decreases the resolution of polygon boundaries. Also known as "pruning", this is when a polyline made of several line segments is replaced by one straight line. I suppose it is by design since the description says "Sparsely represents linear portions of the path by the minimal number of points." There is a tolerance parameter, but it is only used for Bezier curves (S and C commands). In fact the relevant code resides in dependency svg-path-to-polygons.

Is there a way to make this behavior optional, like an additional parameter "pruning: true/false" ?