Browse Source

non-working OSM geocoding

Petra Lamborn 4 years ago
parent
commit
9792f10c08
2 changed files with 5 additions and 4 deletions
  1. 1
    0
      .gitignore
  2. 4
    4
      scratch.R

+ 1
- 0
.gitignore View File

@@ -1,3 +1,4 @@
1
+osm_api.R
1 2
 # ---> R
2 3
 # RStudio project files
3 4
 *.Rproj

+ 4
- 4
scratch.R View File

@@ -1,8 +1,10 @@
1 1
 # Scratch file
2 2
 library(janitor)
3 3
 library(dplyr)
4
-library(ggmap)
4
+#library(ggmap)
5
+library(nominatim)
5 6
 library(readr)
7
+source("osm_api.R")
6 8
 Geo2017 <- clean_names(read_csv("data/AllDHBsGeocoded.csv"), case = "snake") %>%
7 9
     select(-facility_opening_date) %>%
8 10
     mutate(dhb_name = ifelse(is.na(dhb_name), "Missing", dhb_name),
@@ -43,6 +45,4 @@ gp_new <- filter(gp_prac, is.na(gp_prac$calculated_address)) %>%
43 45
 table(newFacil$facility_type_name)
44 46
 table(Geo2017$facility_type_name)
45 47
 
46
-newcoded <- geocode(gp_new$address, 
47
-                    output = "latlona") %>% 
48
-    rename("calculated_address" = address)
48
+newcoded <- osm_geocode(gp_new$address[1:5])