Reads a vector map (e.g., shapefile) that is intended to be corrected.
Arguments
- shp_path
A character string specifying the path to the input map file (e.g., a shapefile).
- ...
Arguments passed to
sf::st_read
Details
This function reads the geospatial file using sf::st_read
. If the
file contains polygon geometries and does not already have an area column
named 'area_old', this function will calculate the area of each feature and
add it.
Examples
if (FALSE) { # \dontrun{
# First, create a demo shapefile
demo_files <- create_demo_data()
# Read the map that needs correction
map_to_correct <- read_map(shp_path = demo_files$shp_path, quiet = TRUE)
# The output is now ready to be used in the `correct_map()` function
# after a model has been trained.
plot(sf::st_geometry(map_to_correct))
} # }