用于地理编码(街道位置!)和下一个距离计算的包
编辑:并且包不是两个lan-long点之间的地理距离,而是乘汽车或步行的距离(就像这样http://code.google.com/intl/sk/apis/maps/documentation/directions/)出行方式——驾车、步行。没有地图,只有距离。谢谢你的任何想法。
你好。我在 R 中搜索包,它给了我包含 10000 个位置(例如“街道、城镇、欧洲”)的数据框的经度和纬度。
然后打包,得出这些位置的每个半正矢公式的距离。但主要是针对经纬度的包装。距离应该很容易。
我搜索了很多,但没有发现任何对我有用的东西。感谢您的帮助!我希望 R 知道这一点:)
EDIT: And package for not geographical distance between two lan-long points, but distance by car, or foot (like this http://code.google.com/intl/sk/apis/maps/documentation/directions/) Travel mode - driving, walking. No map, just distance. Thanks for any idea.
Hello. I search package in R, what gives me longtitude and latitude for data frame with 10000 locations like this "STREET, town, Europe".
And then package, what gives me distance per haversine formula for those locations. But mainly package for lat-long.. Distance should be easy.
I searched a lot but found nothing useful for me. Thanks for help! I hope that R knows it :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
软件包
dismo
具有地址级别geocode()
,但在某些平台上安装可能很困难。包
sp
在spDistsN1()
中具有 WGS84 椭圆体距离。Package
dismo
has address levelgeocode()
, though installation can be difficult on some platforms.Package
sp
has WGS84 ellipsoidal distance inspDistsN1()
.获取街道位置将需要谷歌的帮助或类似的帮助。或者可能是 OpenStreetMap,但我不确定 API 是什么:
http://nominatim.openstreetmap.org/
对于仅城市,请使用我的 geonames 包在 geonames 数据库中搜索人口稠密的地方:
Getting street locations is going to need google's help or similar. Or possibly OpenStreetMap, but I'm not sure what the API is:
http://nominatim.openstreetmap.org/
For just cities, search the geonames database for populated places using my geonames package:
您可以使用“ggmap”包中的“mapdist”函数
You may use function 'mapdist' in 'ggmap' package
有关经/纬度点之间的距离,请参阅“geosphere”包。
'gdistance' 执行诸如成本距离(在网格上)之类的操作。
对于沿道路的距离等也许你可以使用 igraph
See package 'geosphere' for distances between lon/lat points.
'gdistance' does things like cost-distance (on grids).
For distances along roads etc perhaps you can use igraph
您可以尝试使用 this 循环访问您的地址方法。
或者离开 R 并利用 Python 的 geopy。
You could try looping through your addresse using this method.
Or leave R and take advantege of Python's geopy.