This function tidies spatial data converting the attribute columns to snake case, set the supplied coordinate reference system, extracting the polygons from a geometry collection and optionally checking for invalid geometry.
tidy_spatial_data(sf_data, epsg_number, check_valid = FALSE)
sf_data | The spatial data frame to tidy as a sf spatial object. |
---|---|
epsg_number | EPSG number as an integer. |
check_valid | Should the invalid geometry by checked (TRUE) or not as the default (FALSE). |
The tidied spatial data frame returned as a sf spatial object.
if (FALSE) { tidy_spatial_data(sf_data = uk_ireland_base_map, epsg_number = 27700, check_valid = TRUE) }