library(readxl)
library(ggmap)
## 필요한 패키지를 로딩중입니다: ggplot2
## ℹ Google's Terms of Service: <https://mapsplatform.google.com>
## Stadia Maps' Terms of Service: <https://stadiamaps.com/terms-of-service/>
## OpenStreetMap's Tile Usage Policy: <https://operations.osmfoundation.org/policies/tiles/>
## ℹ Please cite ggmap if you use it! Use `citation("ggmap")` for details.
library(dplyr)
##
## 다음의 패키지를 부착합니다: 'dplyr'
##
## The following objects are masked from 'package:stats':
##
## filter, lag
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
data <- read_excel("C:/R_Sample/복지관1.xlsx")
register_google(key="AIzaSyBDSAqpeWrydo385GZdMsloBsYkfj5GaJE")
strK="서울역"
location = geocode(strK)
## ℹ <https://maps.googleapis.com/maps/api/geocode/json?address=%EC%84%9C%EC%9A%B8%EC%97%AD&key=xxx>
markers_data <- data.frame(lon=location$lon, lat=location$lat)
gg_map <- get_googlemap(strK, maptype="roadmap", zoom = 10, markers = markers_data)
## ℹ <https://maps.googleapis.com/maps/api/staticmap?center=%EC%84%9C%EC%9A%B8%EC%97%AD&zoom=10&size=640x640&scale=2&maptype=roadmap&markers=37.555946,126.972317&key=xxx>
## ℹ <https://maps.googleapis.com/maps/api/geocode/json?address=%EC%84%9C%EC%9A%B8%EC%97%AD&key=xxx>
ggmap(gg_map)

location = geocode(strK)
## ℹ <https://maps.googleapis.com/maps/api/geocode/json?address=%EC%84%9C%EC%9A%B8%EC%97%AD&key=xxx>
location
## # A tibble: 1 × 2
## lon lat
## <dbl> <dbl>
## 1 127. 37.6
