ms_explode | R Documentation |
For objects of class Spatial
(e.g., SpatialPolygonsDataFrame
),
you may find it faster to use sp::disaggregate
.
ms_explode(input, ...)
input |
One of:
|
... |
Arguments passed on to
|
There is currently no method for SpatialMultiPoints
same class as input
library(geojsonsf)
library(sf)
poly <- "{\"type\":\"FeatureCollection\",\"features\":
[\n{\"type\":\"Feature\",\"geometry\":{\"type\":
\"MultiPolygon\",\"coordinates\":[[[[102,2],[102,3],
[103,3],[103,2],[102,2]]],[[[100,0],[100,1],[101,1],
[101,0],[100,0]]]]},\"properties\":{\"a\":0}}\n]}"
poly <- geojson_sf(poly)
plot(poly)
length(poly)
poly
# Explode the polygon
out <- ms_explode(poly)
plot(out)
length(out)
out
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.