https://github.com/turfjs/turf-isobands
Takes a FeatureCollection of points with z values and an array of value breaks and generates filled contour isobands.
https://github.com/turfjs/turf-isobands
Last synced: about 1 month ago
JSON representation
Takes a FeatureCollection of points with z values and an array of value breaks and generates filled contour isobands.
- Host: GitHub
- URL: https://github.com/turfjs/turf-isobands
- Owner: Turfjs
- License: mit
- Created: 2014-05-13T19:15:45.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T13:38:30.000Z (about 8 years ago)
- Last Synced: 2025-04-23T06:50:00.401Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 88.9 KB
- Stars: 12
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DEPRECATED - replaced with [`@turf/isobands`](https://github.com/Turfjs/turf/tree/master/packages/turf-isobands)
# turf-isobands[](http://travis-ci.org/Turfjs/turf-isobands)
turf isobands module
### `turf.isobands(points, z, breaks)`
Takes a `pointGrid` FeatureCollection of points with z values and an array of
value breaks and generates filled contour isobands. These are commonly
used to create elevation maps, but can be used for general data
interpolation as well.### Parameters
| parameter | type | description |
| ------------ | ----------------- | ---------------------------------------------------- |
| `points` | FeatureCollection | - grid of points |
| `z` | string | - a property name from which z values will be pulled |
| `breaks` | Array. | - where to draw contours |### Example
```js
// create a grid of points with random z-values in their properties
var bbox = [-70.823, -33.553, -69.823, -32.553];
var cellWidth = 5;
var pointGrid = turf.pointGrid(bbox, cellWidth);
for (var i = 0; i < pointGrid.features.length; i++) {
pointGrid.features[i].properties.elevation = Math.random() * 10;
}
var breaks = [0, 2.8, 5, 8.5];
var isolined = turf.isobands(pointGrid, 'z', breaks);
//=isolined```
**Returns** `FeatureCollection`, isolines (`MultiPolygons`)
## Installation
Requires [nodejs](http://nodejs.org/).
```sh
$ npm install turf-isobands
```## Tests
```sh
$ npm test
```