oa_get: Get data from Openaddresses

Description Usage Arguments Value References Examples

View source: R/oa_get.R

Description

Get data from Openaddresses

Usage

1
oa_get(x, overwrite = FALSE, ...)

Arguments

x

(character) URL for an openaddresses dataset, or an object of class openadd

overwrite

(logical) Will only overwrite existing path if TRUE

...

Pass on curl options to crul::HttpClient()

Value

a tibble (a data.frame), with attributes for original url and path on disk

References

https://openaddresses.io/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
(out1 <- oa_get("http://data.openaddresses.io/runs/142103/at/tirol.zip"))
(out2 <-
  oa_get("http://data.openaddresses.io/runs/142676/ca/bc/victoria.zip"))

# from a openadd class object
oa_get(as_openadd(country="us", state="nv", city="las_vegas"))

# combine data sets
(alldat <- oa_combine(out1, out2))

# Map data
if (!requireNamespace("leaflet")) {
  install.packages("leaflet")
}
library(leaflet)
small <- out2[[1]][1:5000,]
leaflet(small) %>%
  addTiles() %>%
  addCircles(lat = ~LAT, lng = ~LON,
             popup = unname(apply(small[, c('NUMBER', 'STREET')], 1,
             paste, collapse = " ")))

## End(Not run)

sckott/openadds documentation built on March 20, 2021, 9:53 a.m.