ateucher / rmapshaper

An R wrapper for the mapshaper javascript library
http://andyteucher.ca/rmapshaper/
Other
200 stars 13 forks source link

Preventing deletion of polygons #166

Closed ericvmai closed 11 months ago

ericvmai commented 11 months ago

I have a large geojson that is needing to be simplified with a keep of 0.1. However, when doing this, I lose three polygons in the process. Is there any way to prevent polygon loss while still simplifying the other polygons?

I have to increase the keep to 0.38 to maintain the three polygons that are lost.

ateucher commented 11 months ago

There is a keep_shapes argument in ms_simplify(). Have you tried setting that to TRUE? https://andyteucher.ca/rmapshaper/reference/ms_simplify.html

ericvmai commented 11 months ago

totally my fault for not seeing that as an option. works great! Thanks again for creating this.