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.

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 yyyy. Defaults to 1977.

harmonize

Logical. When FALSE (Default), the function returns the raw data. If TRUE, the function returns harmonized data to the same city, across all the years.

geometry

Character. The type of spatial data to be opened. Options include c("zone","district", "municipality").

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"
)