Displaying 1 result from an estimated 1 matches for "getroaddist".
2009 Nov 15
1
R crashing
...rote a little function that takes
addresses (coordinates) as input, and returns the road distance between
every two points using Google Maps. Catch is, there are 2000 addresses, so I
have to get around 2x10^6 addresses. On my first go, this is what I did:
#########################################
getRoadDist = function(X,complete=F){ # X must be a matrix or data frame
of coordinates; lat and lon
require(RCurl)
Y = apply( X, 1, function(x){ paste(x[1], ",", x[2], sep="") } )
grid = expand.grid(Y,Y,KEEP.OUT.ATTRS=F)
grid = apply(grid,1,function(x){paste(x[1],"&...