data-raw/create_boston_data.R

library(konigsbergr)

raw_boston <- get_osm_bbox(xmin = -71.1383,
                           xmax = -71.1132,
                           ymin = 42.3592,
                           ymax = 42.3754)

# Must explicitly set the encoding of all characters in the data to UTF-8 to
# pass CRAN checks of the data
levels(raw_boston$nodes$attrs$user) <- iconv(levels(raw_boston$nodes$attrs$user), "UTF-8")
levels(raw_boston$ways$attrs$user) <- iconv(levels(raw_boston$ways$attrs$user), "UTF-8")
levels(raw_boston$relations$attrs$user) <- iconv(levels(raw_boston$relations$attrs$user), "UTF-8")

levels(raw_boston$nodes$tags$v) <- iconv(levels(raw_boston$nodes$tags$v), "UTF-8")
levels(raw_boston$ways$tags$v) <- iconv(levels(raw_boston$ways$tags$v), "UTF-8")
levels(raw_boston$relations$tags$v) <- iconv(levels(raw_boston$relations$tags$v), "UTF-8")

boston <- raw_boston
use_data(boston, overwrite = TRUE)
dSHARP-CMU/konigsbergr documentation built on Sept. 11, 2019, 3:55 p.m.