I would like to run a batch process to derive the total driving distance between points, for a largish set of point-pairs.

e.g. I would have data something like:

Start_ID    Start_Lat    Start_Long    Dest_ID    Dest_Lat    Dest_Long
00000001    42.12345     -76.54321     10000000   41.12345    -75.54321

What I would like to get returned from this is the driving distance.

I have tried this using a few web services, but the latency is such that it would take too long for my purposes. I have potentially millions of routes to compute, so a latency of a couple seconds quickly adds up to way too much! :)

I have seen some references to setting up an OSRM instance as well as other references to PostGIS with pgRouting. I don't know these tools, so I am not sure if they would meet my requirements or if there is another tool that would be better.

So, what good solutions exist for generating total driving distance for many pairs of points, to execute in batch mode?

  • Have you seen OpenRouteService? wiki.openstreetmap.org/wiki/OpenRouteService - your source data will have to be crystal clean (osm is not) and spatial indexed correctly for fast batches.
    – Mapperz
    Jun 10, 2013 at 16:45
  • I was looking at the website [openrouteservice.org/] and was given the following message when trying to get a route from home to work: "Notice: the Route Service is at this time only for Europe!" My dataset consists of addresses in North America currently, so it doesn't look like OpenRouteService will do the trick at this time.
    – Gabe
    Jun 11, 2013 at 14:33
  • Open Source Routing Machine (OSRM) might be the solution for you project-osrm.org
    – Mapperz
    Jun 11, 2013 at 14:39

1 Answer 1


Some of our customers use RW Net 4 for similar calculations, million of routes every week. This is done locally, so there is no overhead from calling a web service. The key thing here is what quality you expect from the street network and which area you work in? OSM is free, but far from perfect.

  • If i have a network the size of US and I wanted to develop an OD matrix for roughly 20,000 nodes. How long will that take to develop for one iteration using RWNET?
    – dassouki
    Jul 11, 2013 at 0:15
  • You mean a detailed street network (vs. main roads only) and the nodes more or less evenly spread out over the whole area? And you just need the time for fastest route? Jul 11, 2013 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.