rmapshaper
rmapshaper copied to clipboard
underlying algorithm
I'm interested in apply the underlying Visvalingam algorithm directly to paths, do you know if it's available in R independently of the mapshaper interface?
The approach for sf polygons could be taken to identify shared boundaries, simplify those and then piece back together. I've tried this with smoothr
and it seems to work:
https://github.com/hypertidy/silicate/issues/64
Obviously I'd have to write all the de- and re- compose code for sf, but I've found easier ways than the current ARC
approach shown there, so first examples could use lines.
Looks very cool @mdsumner. Unfortunately I've never seen it implemented in R...
I think I understand it! I put up an early stab here, it's no use for sf yet and lots to do still. I also assume there are cases when the disconnected shared boundaries will intersect others after simplification, so mapshaper must do some extra checks somehow.
https://github.com/mdsumner/simpler
Fantastic! Thanks @mdsumner. mapshaper does to post-checks and repairs intersections. From the wiki:
By default, mapshaper rolls back simplification along pairs of intersecting line segments by re-introducing removed points until either the intersection disappears or there are no more points to add.