read_map {odbr} | R Documentation |
Download spatial data from OD Surveys databases
Description
read_map()
download the geodetic data for a specific Origin Destination survey
and return it as an sf dataframe. It uses the cached data file if it was
previously downloaded to avoid extra networking consumption. To understand
the returned dataframe format, please reefer to the read_dictionary()
function for the same survey cohort.
It is also necessary to specify the geometry granularity wanted, be it
"municipality", "district" or "zone" level of details. Of course, not all
geometries are available for all surveys.
Usage
read_map(city = "São Paulo", year = 2017, harmonize = FALSE, geometry = "zone")
Arguments
city |
Character. City of reference. Defaults to "São Paulo". |
year |
Numeric. Year of reference in the format |
harmonize |
Logical. When |
geometry |
Character. The type of spatial data to be opened. Options
include |
Value
An "sf" "data.frame"
object
Examples
library(odbr)
# return zone data from OD Surveys database as sf object at a given city and year
df <- read_map(
city = "Sao Paulo",
year = 2017,
harmonize = FALSE,
geometry = "zone"
)
#' # return district data from OD Surveys database as sf object at a given city and year
df <- read_map(
city = "Sao Paulo",
year = 2017,
harmonize = FALSE,
geometry = "district"
)
# return municipality data from OD Surveys database as sf object at a given city and year
df <- read_map(
city = "Sao Paulo",
year = 2017,
harmonize = FALSE,
geometry = "municipality"
)