isochrone
v3.0.2
Published
isochrone map library
Downloads
28
Readme
Isochrone
Isochrone maps are commonly used to depict areas of equal travel time. Build isochrones using OSRM, Turf and concaveman.
Installation
npm install -g isochrone
Build graph
wget https://s3.amazonaws.com/metro-extracts.mapzen.com/moscow_russia.osm.pbf
./node_modules/osrm/lib/binding/osrm-extract -p ./node_modules/osrm/profiles/foot.lua moscow_russia.osm.pbf
./node_modules/osrm/lib/binding/osrm-contract moscow_russia.osrm
Usage
const OSRM = require('osrm');
const isochrone = require('isochrone');
const osrm = new OSRM({ algorithm: 'CH', path: './moscow_russia.osrm' });
const startPoint = [37.62, 55.75];
const options = {
osrm,
radius: 2,
cellSize: 0.1,
intervals: [5, 10, 15]
};
isochrone(startPoint, options)
.then((geojson) => {
console.log(JSON.stringify(geojson, null, 2));
})
.catch((error) => {
console.error(error);
});
See API for more info.