ateucher / rmapshaper

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

ms_simplify returns corrputed file because of GeoJSON size limit #164

Open victorcazalis opened 1 year ago

victorcazalis commented 1 year ago

I got an error when using ms_simplify with a large shapefile saying the file is corrupted and cannot be written: "The source could be corrupt or not supported. See st_drivers() for a list of supported formats." After some investigation (see details here) it turns out this is due to a default maximum size limit of 200MB for GeoJSON files. This can be changed with Sys.setenv(OGR_GEOJSON_MAX_OBJ_SIZE=900)

It could be worth adding a warning in ms_simplify when that errors is returned to indicate how to increase this limit.

(sorry Andy, I didn't see your request to open an issue before today, although you wrote it 5 months ago :/ )