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
+osm_api.R
1
 # ---> R
2
 # ---> R
2
 # RStudio project files
3
 # RStudio project files
3
 *.Rproj
4
 *.Rproj

+ 4
- 4
scratch.R View File

1
 # Scratch file
1
 # Scratch file
2
 library(janitor)
2
 library(janitor)
3
 library(dplyr)
3
 library(dplyr)
4
-library(ggmap)
4
+#library(ggmap)
5
+library(nominatim)
5
 library(readr)
6
 library(readr)
7
+source("osm_api.R")
6
 Geo2017 <- clean_names(read_csv("data/AllDHBsGeocoded.csv"), case = "snake") %>%
8
 Geo2017 <- clean_names(read_csv("data/AllDHBsGeocoded.csv"), case = "snake") %>%
7
     select(-facility_opening_date) %>%
9
     select(-facility_opening_date) %>%
8
     mutate(dhb_name = ifelse(is.na(dhb_name), "Missing", dhb_name),
10
     mutate(dhb_name = ifelse(is.na(dhb_name), "Missing", dhb_name),
43
 table(newFacil$facility_type_name)
45
 table(newFacil$facility_type_name)
44
 table(Geo2017$facility_type_name)
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])