def geom_each(geojson, callback):
    """
    Iterate over each geometry in any GeoJSON object, similar to Array.forEach()
    :param geojson: Point|Polygon|MultiPolygon|MultiPoint|LineString|MultiLineString|FeatureCollection|Feature geojson any GeoJSON object
    :param callback:
    :return:
    """
    feature_index = 0
    is_feature_collection = geojson['type'] == 'FeatureCollection'
    is_feature = geojson['type'] == 'Feature'
    stop = len(geojson['features']) if is_feature_collection else 1
    for i in range(0, stop):
        if is_feature_collection:
            geometry_maybe_collection = geojson['features'][i]['geometry']
            feature_properties = geojson['features'][i].get('properties')
            feature_b_box = geojson['features'][i].get('bbox')
            feature_id = geojson['features'][i].get('id')
        elif is_feature:
            geometry_maybe_collection = geojson['geometry']
            feature_properties = geojson.get('properties')
            feature_b_box = geojson.get('bbox')
            feature_id = geojson.get('id')
        else:
            geometry_maybe_collection = geojson
            feature_properties = {}
            feature_b_box = None
            feature_id = None
        if geometry_maybe_collection:
            if geometry_maybe_collection['type'] == 'GeometryCollection':
                is_geometry_collection = True
            else:
                is_geometry_collection = False
        stop_g = len(geometry_maybe_collection['geometries']
            ) if is_geometry_collection else 1
        for g in range(0, stop_g):
            geometry = geometry_maybe_collection['geometries'][g
                ] if is_geometry_collection else geometry_maybe_collection
            if not geometry:
                if not callback(None, feature_index, feature_properties,
                    feature_b_box, feature_id):
                    return False
                continue
            if geometry['type'] == 'Point' or geometry['type'
                ] == 'LineString' or geometry['type'
                ] == 'MultiPoint' or geometry['type'] == 'Polygon' or geometry[
                'type'] == 'MultiLineString' or geometry['type'
                ] == 'MultiPolygon':
                if not callback(geometry, feature_index, feature_properties,
                    feature_b_box, feature_id):
                    return False
                break
            elif geometry['type'] == 'GeometryCollection':
                for j in range(0, len(geometry['geometries'])):
                    if not callback(geometry['geometries'][j],
                        feature_index, feature_properties, feature_b_box,
                        feature_id):
                        return False
                break
            else:
                raise Exception('Unknown Geometry Type')
        feature_index += feature_index + 1
