turf-reclass
turf reclass module
turf.reclass(input, inField, outField, translations)
Takes a FeatureCollection, an input field, an output field, and an array of translations and outputs an identical FeatureCollection with the output field property populated.
Parameters
parameter | type | description |
---|---|---|
input |
FeatureCollection | a FeatureCollection of any type |
inField |
string | the field to translate |
outField |
string | the field in which to store translated results |
translations |
Array. | an array of translations |
Example
var points = turf;// 0 to 200 will map to "small", 200 to 400 will map to "medium", 400 to 600 will map to "large"var translations = 0 200 "small" 200 400 "medium" 400 600 "large"; var reclassed = turf; //=reclassed
Installation
Requires nodejs.
$ npm install turf-reclass
Tests
$ npm test