R - 如何将经度和纬度坐标转换为地址/人类可读位置? [英] R - How to convert latitude and longitude coordinates into an address/ human readable location?
本文介绍了R - 如何将经度和纬度坐标转换为地址/人类可读位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将经度和纬度坐标转换为R中的地址/人类可读位置?例如,我在下面列出了这些数据: $ b
$ b
humandate lat lon
09/10/2014 13:41 41.83174254 -75.87998774
09/10/2014 13:53 41.83189873 - 75.87994957
我想知道纬度41.83174254(经度-75.87998774)的地址/位置。 R可能吗?或与其他东西?
解决方案使用
revgeocode
code> ggmap 包。使用你的data.frame df
: revgeocode(c(df $ lon [1],df $ lat [1]))
27-37 Beech Street,Montrose,PA 18801,USA
你可以在你的data.frame中用这些值创建一个新变量:
df $ textAddress < - mapply(FUN = function(lon,lat)revgeocode(c(lon,lat)),df $ lon,df $ lat)
pre>
How can I convert latitude and longitude coordinates into an address/ human readable location in R?
For instance I have these data below:
humandate lat lon 09/10/2014 13:41 41.83174254 -75.87998774 09/10/2014 13:53 41.83189873 -75.87994957
I want find out what the address/ location is for latitude 41.83174254, longitude -75.87998774. Is it possible with R? or with something else?
解决方案Use the
revgeocode
function from theggmap
package. Using your data.framedf
:revgeocode(c(df$lon[1], df$lat[1])) "27-37 Beech Street, Montrose, PA 18801, USA"
You could create a new variable in your data.frame with these values:
df$textAddress <- mapply(FUN = function(lon, lat) revgeocode(c(lon, lat)), df$lon, df$lat)
这篇关于R - 如何将经度和纬度坐标转换为地址/人类可读位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文