Read a geojson file with mixed geometries geojsonio::geojson_read

255 Views Asked by At

I am trying to create a chorpleth of Belgium in shiny (R) using this geojson file (github view). I am following the tutorial of rstudio to get the basics right. While doing this I encountered the following error while trying to use the geojsonio::geojson_read() function.

Error: Multiple incompatible geometries: wkbPolygon: 586; wkbGeometryCollection: 3

After some debugging I found that, indeed there are 3 GeometryCollections. However these collections are municipalities that have enclaves (multiple polygons for one municipality). One of which it the famous border craziness of Baarle Hertog/Baarle-Nassau. So both wkbPloygons and wkbGeometryCollection should be inside the same layer for plotting.

What would be the easiest way to accomplish this?

0

There are 0 best solutions below