cache_baltimore_data: Cache data for mapbaltimore package

View source: R/cache_data.R

cache_baltimore_dataR Documentation

Cache data for mapbaltimore package

Description

Cache data to rappdirs::user_cache_dir("mapbaltimore")

Usage

cache_baltimore_data(data = NULL, filename = NULL, overwrite = FALSE)

cache_msa_streets(
  url =
    "https://geodata.md.gov/imap/rest/services/Transportation/MD_HighwayPerformanceMonitoringSystem/MapServer/2",
  filename = "baltimore_msa_streets.gpkg",
  crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
  overwrite = FALSE
)

cache_edge_of_pavement(
  url =
    "https://gisdata.baltimorecity.gov/egis/rest/services/OpenBaltimore/Edge_of_Pavement/FeatureServer/0",
  filename = "edge_of_pavement.gpkg",
  crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
  overwrite = FALSE
)

cache_baltimore_property(
  url =
    "https://geodata.baltimorecity.gov/egis/rest/services/Housing/dmxOwnership/MapServer/0",
  location = NULL,
  filename = "baltimore_property.gpkg",
  crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
  overwrite = FALSE
)

show_cached_files()

Arguments

data

Data to cache.

filename

File name to use for cached file. Defaults to name of data. If the data is an sf object make sure to include the file type, e.g. "data.gpkg", supported by sf::write_sf(). All other data is written to rda with readr::write_rds().

overwrite

Logical. Default FALSE. If TRUE, overwrite any existing cached files that use the same filename.

url

URL

crs

Coordinate reference system.

location

sf, sfc, or bbox object (or other object convertible with as_bbox(). Optional.

Details

  • Use cache_msa_streets() to download and cache street centerline data for all counties in the Baltimore metropolitan area.

  • Use cache_edge_of_pavement() to download and cache edge of pavement data for Baltimore city.

Value

show_cached_files() returns a tibble with the columns:

  • file, the name of the file,

  • size_MB, file size in MB,

  • modified, date and time last modified


elipousson/mapbaltimore documentation built on April 2, 2024, 4:23 p.m.