仅使用经度和纬度计算70000个不同位置的行驶距离

时间:2017-03-21 13:33:10

标签: r google-maps rstudio latitude-longitude bing-maps

我需要通过仅使用长和纬来计算从位置A到位置B的行驶距离。 Ggmaps并不好,因为他们在2500次搜索后阻止了他们的服务,我需要70 000次计算。我尝试使用Bing地图,获得了API密钥,但我在R studio中的代码似乎并不合适。所以我有:

  1. Rstudio
  2. 很多长计算和计算
  3. bing maps的API密钥
  4. 无法正常工作的R代码。
  5. 有人知道如何自动化这个过程吗?

    任何帮助将不胜感激。康斯坦丁 这是代码:

    DF <- read.csv("clipboard", header=T, sep ="\t", quote = "", row.names =            NULL, stringsAsFactors = FALSE)
    
    View(DF)
    
    Plant.name <- DF[ ,1]
    Plant.City <- DF[ ,2]
    Postal.code <- DF[ ,3]
    Country.plant <- DF[ ,4]
    Plant.lat <- DF[ ,5]
    Plant.long <- DF[ ,6]
    NU <- DF[ , 7]
    TS.level.2.code <- DF[ ,8]
    NUTS.level.2.city <- DF[ ,9]
    NUTS.level.2.label <- DF[ ,10]
    NUTS.level.2.country <- DF[ ,11]
    Tzone.moonshine <- DF[ ,12]
    Tr..AP <- DF[ ,13]
    Tr.zn.AP2 <- DF[ ,14]
    Zip.Code.Nuts <- DF[ ,15]
    Longitude <- DF[ ,16]
    Latitude<- DF[ ,17]
    Code <- DF[ ,18]
    
    # create distance matrix
    
    mat <- distm(DF[,c('Plant.lat','Plant.Long')],         DF[,c('longitude','latitude')], fun=distVincentyEllipsoid) # that didnt work out
    
    install.packages(taRifx.geo::georoute)
    
    georoute( c("50.666 13.795", 
            "47.50827271,   16.48046829"), 
          verbose=TRUE, returntype="time", 
          service="bing" ) # but I would like to have it in driving distance
    getDist(from="1 Infinity Loop, Cupertino, CA 95014", to="1600 Amphitheatre         Pkwy, Mountain View, CA 94043",modus="driving",get="distance")# I also tried to     make a loop, but didnt work out    
    

0 个答案:

没有答案
相关问题