# def checkCoordsPoint(list):
import geojson

dump = """{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:3857"
    }
  },
  "features": [{
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [0, 0]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, -2e6], [8e6, 2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, 2e6], [8e6, -2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[-5e6, -1e6], [-4e6, 1e6], [-3e6, -1e6]]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiLineString",
      "coordinates": [
        [[-1e6, -7.5e5], [-1e6, 7.5e5]],
        [[1e6, -7.5e5], [1e6, 7.5e5]],
        [[-7.5e5, -1e6], [7.5e5, -1e6]],
        [[-7.5e5, 1e6], [7.5e5, 1e6]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiPolygon",
      "coordinates": [
        [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [-3e6, 6e6]]],
        [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], [0, 6e6]]],
        [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "GeometryCollection",
      "geometries": [{
        "type": "LineString",
        "coordinates": [[-5e6, -5e6], [0, -5e6]]
      }, {
        "type": "Point",
        "coordinates": [4e6, -5e6]
      }, {
        "type": "Polygon",
        "coordinates": [[[1e6, -6e6], [2e6, -4e6], [3e6, -6e6]]]
      }]
    }
  }]
}"""


def toGeoJson(obj):
    try:
        return geojson.loads(obj)
    except TypeError as e:
        return {"error": "не удалось загрузить geoJson, документ не валиден"}

def getNumberObjects(geoJson):
    if geoJson.get("error") and geoJson["error"]:
      return geoJson
    features = geoJson.features
    finalStruct = {}
    for item in features:
        if finalStruct.get(item.geometry.type):
            finalStruct[item.geometry.type] += 1 
        else:
            finalStruct[item.geometry.type] = 1
        try:
            item.geometry.geometries
            for i in item.geometry.geometries:
                if finalStruct.get(i.type):
                    finalStruct[i.type] += 1 
                else:
                    finalStruct[i.type] = 1         
        except:
            pass    
    return finalStruct


if __name__ == "__main__":
    f = toGeoJson(dump)
    print(getNumberObjects(f))
8598f43192d604ea459dfb5dc7b0c14704c7bcb1
<mask token>


def getNumberObjects(geoJson):
    if geoJson.get('error') and geoJson['error']:
        return geoJson
    features = geoJson.features
    finalStruct = {}
    for item in features:
        if finalStruct.get(item.geometry.type):
            finalStruct[item.geometry.type] += 1
        else:
            finalStruct[item.geometry.type] = 1
        try:
            item.geometry.geometries
            for i in item.geometry.geometries:
                if finalStruct.get(i.type):
                    finalStruct[i.type] += 1
                else:
                    finalStruct[i.type] = 1
        except:
            pass
    return finalStruct


<mask token>

<mask token>


def toGeoJson(obj):
    try:
        return geojson.loads(obj)
    except TypeError as e:
        return {'error': 'не удалось загрузить geoJson, документ не валиден'}


def getNumberObjects(geoJson):
    if geoJson.get('error') and geoJson['error']:
        return geoJson
    features = geoJson.features
    finalStruct = {}
    for item in features:
        if finalStruct.get(item.geometry.type):
            finalStruct[item.geometry.type] += 1
        else:
            finalStruct[item.geometry.type] = 1
        try:
            item.geometry.geometries
            for i in item.geometry.geometries:
                if finalStruct.get(i.type):
                    finalStruct[i.type] += 1
                else:
                    finalStruct[i.type] = 1
        except:
            pass
    return finalStruct


if __name__ == '__main__':
    f = toGeoJson(dump)
    print(getNumberObjects(f))

<mask token>
dump = """{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:3857"
    }
  },
  "features": [{
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [0, 0]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, -2e6], [8e6, 2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, 2e6], [8e6, -2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[-5e6, -1e6], [-4e6, 1e6], [-3e6, -1e6]]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiLineString",
      "coordinates": [
        [[-1e6, -7.5e5], [-1e6, 7.5e5]],
        [[1e6, -7.5e5], [1e6, 7.5e5]],
        [[-7.5e5, -1e6], [7.5e5, -1e6]],
        [[-7.5e5, 1e6], [7.5e5, 1e6]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiPolygon",
      "coordinates": [
        [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [-3e6, 6e6]]],
        [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], [0, 6e6]]],
        [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "GeometryCollection",
      "geometries": [{
        "type": "LineString",
        "coordinates": [[-5e6, -5e6], [0, -5e6]]
      }, {
        "type": "Point",
        "coordinates": [4e6, -5e6]
      }, {
        "type": "Polygon",
        "coordinates": [[[1e6, -6e6], [2e6, -4e6], [3e6, -6e6]]]
      }]
    }
  }]
}"""


def toGeoJson(obj):
    try:
        return geojson.loads(obj)
    except TypeError as e:
        return {'error': 'не удалось загрузить geoJson, документ не валиден'}


def getNumberObjects(geoJson):
    if geoJson.get('error') and geoJson['error']:
        return geoJson
    features = geoJson.features
    finalStruct = {}
    for item in features:
        if finalStruct.get(item.geometry.type):
            finalStruct[item.geometry.type] += 1
        else:
            finalStruct[item.geometry.type] = 1
        try:
            item.geometry.geometries
            for i in item.geometry.geometries:
                if finalStruct.get(i.type):
                    finalStruct[i.type] += 1
                else:
                    finalStruct[i.type] = 1
        except:
            pass
    return finalStruct


if __name__ == '__main__':
    f = toGeoJson(dump)
    print(getNumberObjects(f))

import geojson
dump = """{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:3857"
    }
  },
  "features": [{
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [0, 0]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, -2e6], [8e6, 2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, 2e6], [8e6, -2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[-5e6, -1e6], [-4e6, 1e6], [-3e6, -1e6]]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiLineString",
      "coordinates": [
        [[-1e6, -7.5e5], [-1e6, 7.5e5]],
        [[1e6, -7.5e5], [1e6, 7.5e5]],
        [[-7.5e5, -1e6], [7.5e5, -1e6]],
        [[-7.5e5, 1e6], [7.5e5, 1e6]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiPolygon",
      "coordinates": [
        [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [-3e6, 6e6]]],
        [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], [0, 6e6]]],
        [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "GeometryCollection",
      "geometries": [{
        "type": "LineString",
        "coordinates": [[-5e6, -5e6], [0, -5e6]]
      }, {
        "type": "Point",
        "coordinates": [4e6, -5e6]
      }, {
        "type": "Polygon",
        "coordinates": [[[1e6, -6e6], [2e6, -4e6], [3e6, -6e6]]]
      }]
    }
  }]
}"""


def toGeoJson(obj):
    try:
        return geojson.loads(obj)
    except TypeError as e:
        return {'error': 'не удалось загрузить geoJson, документ не валиден'}


def getNumberObjects(geoJson):
    if geoJson.get('error') and geoJson['error']:
        return geoJson
    features = geoJson.features
    finalStruct = {}
    for item in features:
        if finalStruct.get(item.geometry.type):
            finalStruct[item.geometry.type] += 1
        else:
            finalStruct[item.geometry.type] = 1
        try:
            item.geometry.geometries
            for i in item.geometry.geometries:
                if finalStruct.get(i.type):
                    finalStruct[i.type] += 1
                else:
                    finalStruct[i.type] = 1
        except:
            pass
    return finalStruct


if __name__ == '__main__':
    f = toGeoJson(dump)
    print(getNumberObjects(f))

# def checkCoordsPoint(list):
import geojson

dump = """{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:3857"
    }
  },
  "features": [{
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [0, 0]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, -2e6], [8e6, 2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "LineString",
      "coordinates": [[4e6, 2e6], [8e6, -2e6]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[-5e6, -1e6], [-4e6, 1e6], [-3e6, -1e6]]]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiLineString",
      "coordinates": [
        [[-1e6, -7.5e5], [-1e6, 7.5e5]],
        [[1e6, -7.5e5], [1e6, 7.5e5]],
        [[-7.5e5, -1e6], [7.5e5, -1e6]],
        [[-7.5e5, 1e6], [7.5e5, 1e6]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "MultiPolygon",
      "coordinates": [
        [[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [-3e6, 6e6]]],
        [[[-2e6, 6e6], [-2e6, 8e6], [0, 8e6], [0, 6e6]]],
        [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]]
      ]
    }
  }, {
    "type": "Feature",
    "geometry": {
      "type": "GeometryCollection",
      "geometries": [{
        "type": "LineString",
        "coordinates": [[-5e6, -5e6], [0, -5e6]]
      }, {
        "type": "Point",
        "coordinates": [4e6, -5e6]
      }, {
        "type": "Polygon",
        "coordinates": [[[1e6, -6e6], [2e6, -4e6], [3e6, -6e6]]]
      }]
    }
  }]
}"""


def toGeoJson(obj):
    try:
        return geojson.loads(obj)
    except TypeError as e:
        return {"error": "не удалось загрузить geoJson, документ не валиден"}

def getNumberObjects(geoJson):
    if geoJson.get("error") and geoJson["error"]:
      return geoJson
    features = geoJson.features
    finalStruct = {}
    for item in features:
        if finalStruct.get(item.geometry.type):
            finalStruct[item.geometry.type] += 1 
        else:
            finalStruct[item.geometry.type] = 1
        try:
            item.geometry.geometries
            for i in item.geometry.geometries:
                if finalStruct.get(i.type):
                    finalStruct[i.type] += 1 
                else:
                    finalStruct[i.type] = 1         
        except:
            pass    
    return finalStruct


if __name__ == "__main__":
    f = toGeoJson(dump)
    print(getNumberObjects(f))