Skip to contents

get_map_data(): Retrieve data via URL service as an sf object. Optionally choose to save a local copy of the data drawing on the sf::st_write() function.

Usage

get_map_data(
  url,
  service = "wfs",
  version = NULL,
  request = "GetFeature",
  typename = NULL,
  outname = NULL,
  append = FALSE
)

Arguments

url

URL to a service from which to retrieve geospatial data

service

service list attribute for httr2::url_parse, default is wfs

version

version list attribute for httr2::url_parse, default is NULL

request

request list attribute for httr2::url_parse, default is GetFeature

typename

typename list attribute for httr2::url_parse, default is NULL

outname

Name of an optional output file with sf::st_write, default is NULL

append

Logical, should the output layer be appended to an existing file (append = TRUE) or overwrite layer (append = FALSE), default is FALSE

Value

An sf object

Examples

finland_municipalities <- get_map_data(
url = "https://geo.stat.fi/geoserver/tilastointialueet/wfs",
typename = "tilastointialueet:kunta1000k")