propEach
Description
Iterate over properties in any GeoJSON object, similar to Array.forEach()
Parameters
Name | Type | Description |
---|---|---|
geojson | FeatureCollection | Feature | any GeoJSON object |
callback | propEachCallback | a method that takes (currentProperties, featureIndex) |
Returns
void
Examples
var features = turf.featureCollection([
turf.point([26, 37], { foo: "bar" }),
turf.point([36, 53], { hello: "world" }),
]);
turf.propEach(features, function (currentProperties, featureIndex) {
//=currentProperties
//=featureIndex
});
Installation
$ npm install @turf/meta
import { propEach } from "@turf/meta";
const result = propEach(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.propEach(...);