def _load_polygons(geojson):
    """
    Loads polygons from a geojson file; should work for both MultiPolygon and
    FeatureCollection of Polygons
    """
    polygons = []
    if geojson['type'] == 'MultiPolygon':
        for polygon in geojson['coordinates']:
            polygons.append(polygon)
    elif geojson['type'] == 'Polygon':
        polygons = [geojson['coordinates']]
    elif geojson['type'] == 'FeatureCollection':
        for feature in geojson['features']:
            geom = feature['geometry']
            polygons.extend(_load_polygons(geom))
    return polygons