lib/turf/meta.rb
def feature_each(geojson, &block)
    return unless geojson

    features = []
    geojson = deep_symbolize_keys geojson
    case geojson[:type]
    when "Feature"
      features.push geojson
    when "FeatureCollection"
      features.push(*geojson[:features])
    end

    features.each_with_index(&block)
  end
# Iterate over features in any GeoJSON object, similar to Array.forEach.
# @see https://turfjs.org/docs/#featureEach
# @param geojson [FeatureCollection|Feature|Geometry] any GeoJSON object
# @yield [feature] given any coordinate
# @yieldparam feature [Feature<any>] currentFeature The current Feature being processed.
# @yieldparam feature_index [number] The current index of the Feature being processed.
Iterate over features in any GeoJSON object, similar to Array.forEach.
Iterate over features in any GeoJSON object similar to Array . forEach .
def feature_each(geojson, &block)
    return unless geojson
    features = []
    geojson = deep_symbolize_keys geojson
    case geojson[:type]
    when "Feature"
      features.push geojson
    when "FeatureCollection"
      features.push(*geojson[:features])
    end
    features.each_with_index(&block)
  end
def feature_each ( geojson , & block ) return unless geojson features = [ ] geojson = deep_symbolize_keys geojson case geojson [ :type ] when "Feature" features . push geojson when "FeatureCollection" features . push ( * geojson [ :features ] ) end features . each_with_index ( & block ) end
Iterate over features in any GeoJSON object, similar to Array.forEach.
Iterate over features in any GeoJSON object similar to Array . forEach .
geojson
any GeoJSON object
any GeoJSON object
block
]
given any coordinate
given any coordinate
feature
currentFeature The current Feature being processed.
currentFeature The current Feature being processed .
feature_index
The current index of the Feature being processed.
The current index of the Feature being processed .
see
None