我有一个csv文件,其中包含R中城市的信息。现在,我需要的是城市的经纬度信息,而不是城市。稍后,我想将这些信息绘制到地图上。
我尝试了多个代码,但是它们都与google一起使用,无法正常工作。
你们中的任何人都知道一种不使用Google API就能获取较长的经时信息的方法吗?
答案 0 :(得分:3)
我认为您可能想检查https://working.${MYDOMAIN}/blah/blah
软件包中的geocode_OSM
函数。例如:
tmaptools
由reprex package(v0.3.0)于2020-04-29创建
该函数使用OpenStreetMap Nominatim,您应该阅读usage policy。您还应该阅读该功能的帮助页面(只需键入# packages
library(tmaptools)
# simple example
geocode_OSM("Milan, Italy")
#> $query
#> [1] "Milan, Italy"
#>
#> $coords
#> x y
#> 9.1905 45.4668
#>
#> $bbox
#> xmin ymin xmax ymax
#> 9.040887 45.386738 9.278110 45.535848
)并检查示例。