Build isochrone using start point and options
startPoint
Array<float> start point [lng, lat]options
Object objectoptions.osrm
Object OSRM instanceoptions.radius
number distance to draw the buffer as in @turf/bufferoptions.cellSize
number the distance across each cell as in @turf/point-gridoptions.intervals
Array<number> intervals for isochrones in minutesoptions.deintersect
boolean whether or not to deintersect the isochrones. If this is true, then the isochrones will be mutually exclusiveoptions.concavity
number relative measure of concavity as in concaveman (optional, default2
)options.lengthThreshold
number length threshold as in concaveman (optional, default0
)options.units
string any of the options supported by turf units (optional, default'kilometers'
)
const OSRM = require('osrm');
const isochrone = require('isochrone');
const osrm = new OSRM({ path: './monaco.osrm' });
const startPoint = [7.41337, 43.72956];
const options = {
osrm,
radius: 2,
cellSize: 0.1,
intervals: [5, 10, 15],
deintersect: true
};
isochrone(startPoint, options)
.then((geojson) => {
console.log(JSON.stringify(geojson));
});
Returns Promise GeoJSON FeatureCollection of Polygons when resolved