[英]Google Maps shortest distance
I have a dataset with start (X) and end (Y) coordinates. 我有一个具有开始(X)和结束(Y)坐标的数据集。 I want to extract the shortest distance from X to Y using Google Maps.
我想使用Google Maps提取从X到Y的最短距离。 Is there any package/function I can use to do this in R?
我可以在R中使用任何软件包/功能吗?
Thanks, 谢谢,
@Dave2e is right. @ Dave2e是正确的。 use the function
mapdist()
from library(ggmap)
. 使用来自
library(ggmap)
mapdist()
library(ggmap)
。 It has also an argument to set the type of distance to compute (see function argument mode = c("driving", "walking", "bicycling")
). 它也有一个参数来设置要计算的距离的类型(请参见函数参数
mode = c("driving", "walking", "bicycling")
)。 Remember that google maps api limits to 2500 element queries a day. 请记住,Google每天将api限制为2500个元素查询。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.