import_from_gpkg: Import an 'sf' object using a geopackage URL

View source: R/import_from_gpkg.R

import_from_gpkgR Documentation

Import an sf object using a geopackage URL

Description

This function is particularly useful for importing data from Minnesota Geospatial Commons when access to GISLibrary is unavailable.

Usage

import_from_gpkg(
  link,
  save_file = FALSE,
  save_path = getwd(),
  .crs = 4326,
  keep_temp = FALSE,
  .quiet = TRUE
)

import_gpkg(
  link,
  save_file = FALSE,
  save_path = getwd(),
  .crs = 4326,
  keep_temp = FALSE,
  .quiet = TRUE
)

Arguments

link

character, URL for the .gpkg object

save_file

logical, whether to save the downloaded file. File will be saved in .RDS format

save_path

character, the path where the downloaded file should be saved. Default location is the working directory.

.crs

numeric, the CRS code or string used to transform the download. Default is 4326 (WGS 84)

keep_temp

character, whether to keep the temporary download. Default is FALSE.

.quiet

logical, suppress messages. Default is TRUE.

Value

sf::sf() object

Note

This function relies on {rlang} internal functions.

Examples


library(councilR)

# import regional parks from Minnesota Geospatial Commons
import_from_gpkg("https://resources.gisdata.mn.gov/pub/gdrs/data/pub/us_mn_state_metc/plan_parks_regional/gpkg_plan_parks_regional.zip")


Metropolitan-Council/councilR documentation built on March 30, 2024, 2:43 a.m.