Warning: this is experimental.
Calculate large distance matrix using The Open Source Routing Machine
npm install distance-matrix
...or build from source
git clone https://github.com/stepankuzmin/distance-matrix.git
cd distance-matrix
npm install
An osrm file is required for routing. This can be generated using included binaries. (Note: this will take a lot of processing power if you are planning to use the entire planet.osm file, for general use a regional OSM data extract is preferable. More info here)
# first download an osm file containing the area you need
./node_modules/distance-matrix/osrm/lib/binding/osrm-extract mydata.osm -p ./node_modules/distance-matrix/osrm/test/data/car.lua
./node_modules/distance-matrix/osrm/lib/binding/osrm-prepare mydata.osrm -p ./node_modules/distance-matrix/osrm/test/data/car.lua
See the API, examples/tsv/index.js
and test/index.js
for examples of calculating large distance matrices.