distance-matrix
v1.1.2
Published
Calculate large distance matrix using The Open Source Routing Machine
Downloads
3
Readme
OSRM distance matrix
Warning: this is experimental
Calculate large distance matrix using The Open Source Routing Machine
Installation
npm install distance-matrix
...or build from source
git clone https://github.com/stepankuzmin/distance-matrix.git
cd distance-matrix
npm install
Build
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
Usage
See the API, examples/tsv/index.js
and test/index.js
for examples of calculating large distance matrices.