使用revgeocode()
revgeocode(location = c(125.35, 43.8634))
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?latlng=43.8634,125.35&sensor=false
[1] "Jun Zhuan Hu Tong, Nanguan Qu, Changchun Shi, Jilin Sheng, China, 130022"
そして、あなたはより多くの詳細が必要な場合は、指定output = 'all'
res <- revgeocode(location = c(125.35, 43.8634), output = 'all')
str(res)
# List of 2
# $ results:List of 6
# ..$ :List of 5
# .. ..$ address_components:List of 6
# .. .. ..$ :List of 3
# .. .. .. ..$ long_name : chr "Jun Zhuan Hu Tong"
# .. .. .. ..$ short_name: chr "Jun Zhuan Hu Tong"
# .. .. .. ..$ types : chr "route"
# .. .. ..$ :List of 3
# .. .. .. ..$ long_name : chr "Nanguan Qu"
# .. .. .. ..$ short_name: chr "Nanguan Qu"
# .. .. .. ..$ types : chr [1:3] "political" "sublocality" "sublocality_level_1"
# .. .. ..$ :List of 3
# .. .. .. ..$ long_name : chr "Changchun Shi"
# .. .. .. ..$ short_name: chr "Changchun Shi"
# .. .. .. ..$ types : chr [1:2] "locality" "political"
# .. .. ..$ :List of 3
# .. .. .. ..$ long_name : chr "Jilin Sheng"
# .. .. .. ..$ short_name: chr "Jilin Sheng"
# .. .. .. ..$ types : chr [1:2] "administrative_area_level_1" "political"
# ... etc