Reduce GEOMETRYCOLLECTION geometries to their polygon parts
Source:R/map.R
extract_polygon_collection.RdReduce GEOMETRYCOLLECTION geometries to their polygon parts
Value
The sf object with each GEOMETRYCOLLECTION replaced by its
combined polygon parts (empty polygon if it has none).
See also
Other app support interfaces:
build_nearest_layers(),
guess_name_col(),
layer_id_col(),
render_postal_reproducer_script(),
render_reproducer_script()
Examples
polygon <- sf::st_polygon(list(rbind(
c(0, 0), c(1, 0), c(1, 1), c(0, 0)
)))
collection <- sf::st_geometrycollection(list(polygon))
layer <- sf::st_sf(
name = "Example",
geometry = sf::st_sfc(collection, crs = 4326)
)
extract_polygon_collection(layer)
#> Simple feature collection with 1 feature and 1 field
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: 0 ymin: 0 xmax: 1 ymax: 1
#> Geodetic CRS: WGS 84
#> name geometry
#> 1 Example MULTIPOLYGON (((0 0, 1 0, 1...