Created
November 17, 2016 17:50
-
-
Save ateucher/2d03af13b216c942f5b6301aca4232f9 to your computer and use it in GitHub Desktop.
BC Geocoder in R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://api.bcdevexchange.org/api-console.html?swaggerUrl=https://raw.githubusercontent.com/bcgov/api-specs/master/geocoder/geocoder.json#/ | |
library(httr) | |
base_url <- function() "http://apps.gov.bc.ca/pub/geocoder" | |
endpoint <- "addresses" | |
format <- "json" | |
url <- sprintf(paste0(base_url(),"/%s.%s"), endpoint, format) | |
res <- GET(url, query = list(addressString = "525 Superior St, Victoria BC")) | |
foo <- content(res) | |
jsonlite::toJSON(foo[c("type", "features")], auto_unbox = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment