Package Exports
- turf-quantile
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (turf-quantile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
turf-quantile
Takes a set of features, a property name, and a set of percentiles and outputs a quantile array. This can be passed as a break array to the isolines function or the isobands function.
###Install
npm install turf-quantile###Parameters
| name | description |
|---|---|
| pts | points to classify |
| z | z field |
| percentiles | percentiles to classify |
###Usage
quantile(pts, z, percentiles)###Example
var quantile = require('turf-quantile')
var fs = require('fs')
var z = 'elevation'
var percentiles = [10,30,40,60,80,90,99]
var pts = JSON.parse(fs.readFileSync('/path/to/pts.geojson'))
var quantiles = quantile(pts, propertyName, percentiles)
console.log(quantiles) // [ 12, 25, 29, 52, 76, 99, 143 ]