I want to calculate the distance between approx. 100,000 different ZIP codes. I know about the mapdist
function in the ggmap
package
mapdist
works perfectly:
library(ggmap)
mapdist('Washington', 'New York', mode = 'driving')
# from to m km miles seconds minutes hours
# 1 Washington New York 366284 366.284 227.6089 13997 233.2833 3.888056
mapdist('20001', '10001', mode = 'driving')
# from to m km miles seconds minutes hours
# 1 20001 10001 363119 363.119 225.6421 13713 228.55 3.809167
However, mapdist
relies on the Google Geocoding API which is subject to a query limit of 2,500 geolocation requests per day.
Are you aware of any alternative r code to calculate the distance between two points using another service which has a higher request limit (such as Nokia Maps or Bing)?
gdist
fromImap
package that calculates Great-circle distance but I think you need to get lat/long coordinates... – Calchasrdist
package I believe. The advantage of doing it this way is you only need one geocoding lookup per point, instead of one geocoding lookup per pair of points. That could not matter (if you only want observations from distinct pairs of points) or could matter a lot (if all of your routes start from the same point) – Marj