Open Street Map(nominatim
パッケージ)を使用して一連のロケーションをジオコードしたいと考えています。R - オープンストリートマップジオコーディングの結果を入力データとリンクする
経度/緯度に翻訳されない場所があると問題が発生します。実際、入力ベクトルと出力データフレームをリンクする方法はありません。ここで
は一例です:
library(nominatim)
Location <- c("Washington", "Seattle", "Fzoieozepfvfmd", "Houston")
LonLat <- osm_geocode(Location, key = "enter your own OSM key")
View(LonLat)
# 3 observations only while there is 4 locations in the input vector
# no key to join the output data frame with the input vector
出力データフレームLonLat
:
structure(list(place_id = c("2661769953", "151183715", "2691789858"
), licence = c("Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright"
), osm_type = c("relation", "relation", "relation"), osm_id = c("5396194",
"237385", "2688911"), lat = c(38.8949549, 47.6038321, 29.7589382
), lon = c(-77.0366456, -122.3300624, -95.3676974), display_name = c("Washington, District of Columbia, United States of America",
"Seattle, King County, Washington, United States of America",
"Houston, Harris County, Texas, United States of America"), class = c("place",
"place", "place"), type = c("city", "city", "city"), importance = c(0.82665678197628,
0.80154398538761, 0.80088985079359), icon = c("http://ip-10-98-161-100.mq-us-east-1.ec2.aolcloud.net:8000/nominatim/v1/images/mapicons/poi_place_city.p.20.png",
"http://ip-10-98-174-147.mq-us-east-1.ec2.aolcloud.net:8000/nominatim/v1/images/mapicons/poi_place_city.p.20.png",
"http://ip-10-98-183-183.mq-us-east-1.ec2.aolcloud.net:8000/nominatim/v1/images/mapicons/poi_place_city.p.20.png"
), bbox_left = c(38.7916303, 47.4810022, 29.5370705), bbox_top = c(38.9958524,
47.7341357, 30.1103506), bbox_right = c(-77.1197662, -122.4596959,
-95.9097418), bbox_bottom = c(-76.9093659, -122.2244329, -95.0120524
)), .Names = c("place_id", "licence", "osm_type", "osm_id", "lat",
"lon", "display_name", "class", "type", "importance", "icon",
"bbox_left", "bbox_top", "bbox_right", "bbox_bottom"), row.names = c(NA,
-3L), class = "data.frame")
ここに 'LonLat'の結果を表示できますか? –
'dput()'関数を使って質問に出力データフレームを追加しました。 – Kumpelka