turf-isobands
isobands
Takes a grid FeatureCollection of Point features with z-values and an array of
value breaks and generates filled contour isobands.
Parameters
points
FeatureCollection<Point> a FeatureCollection of Point featuresbreaks
Array<number> where to draw contourszProperty
[string] the property name in points
from which z-values will be pulled (optional, default 'elevation'
)options
[Object] options on output (optional, default {}
)
options.isobandProperties
[Array<Object>] GeoJSON properties passed, in order, to the correspondent
isoband (order defined by breaks) (optional, default []
)options.commonProperties
[Object] GeoJSON properties passed to ALL isobands (optional, default {}
)
Examples
var extent = [-70.823364, -33.553984, -69.823364, -32.553984];
var cellWidth = 5;
var units = 'miles';
var pointGrid = turf.pointGrid(extent, cellWidth, units);
for (var i = 0; i < pointGrid.features.length; i++) {
pointGrid.features[i].properties.elevation = Math.random() * 10;
}
var breaks = [0, 5, 8.5];
var isobands = turf.isobands(pointGrid, breaks, 'temp');
var addToMap = [isobands];
Returns FeatureCollection<MultiPolygon> a FeatureCollection of MultiPolygon features representing isobands
This module is part of the Turfjs project, an open source
module collection dedicated to geographic algorithms. It is maintained in the
Turfjs/turf repository, where you can create
PRs and issues.
Installation
Install this module individually:
$ npm install turf-isobands
Or install the Turf module that includes it as a function:
$ npm install @turf/turf