Skip to main content
Version: 7.1.0

propEach

Description

Iterate over properties in any GeoJSON object, similar to Array.forEach()

Parameters

NameTypeDescription
geojsonFeatureCollection | Featureany GeoJSON object
callbackFunctiona 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(...);