1.0.1 • Published 9 years ago

turf-quantile v1.0.1

Weekly downloads
1,432
License
MIT
Repository
github
Last release
9 years ago

turf-quantile

build status

turf quantile module

turf.quantile(input, field, percentiles)

Takes a FeatureCollection, a property name, and a set of percentiles and returns a quantile array.

Parameters

parametertypedescription
inputFeatureCollectiona FeatureCollection of any type
fieldStringthe property on which to retrieve quantile values
percentilesArray.an Array of percentiles on which to calculate quantile values

Example

var points = turf.featurecollection([
  turf.point([5,5], {population: 5}),
  turf.point([1,3], {population: 40}),
  turf.point([14,2], {population: 80}),
  turf.point([13,1], {population: 90}),
  turf.point([19,7], {population: 100})
]);

var breaks = turf.quantile(
  points, 'population', [25, 50, 75, 99]);

//=breaks

Installation

Requires nodejs.

$ npm install turf-quantile

Tests

$ npm test
1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago