ahmedOpeyemi / node-isochrone

NodeJS isochrone map library

Home Page:https://stepankuzmin.github.io/node-isochrone

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Isochrone

npm version npm downloads Build Status

Isochrone maps are commonly used to depict areas of equal travel time. Build isochrones using OSRM, Turf and concaveman.

Screenshot

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.

About

NodeJS isochrone map library

https://stepankuzmin.github.io/node-isochrone

License:MIT License


Languages

Language:JavaScript 91.3%Language:Makefile 8.7%