def point_in_multipolygon ( point , multipoly ) : coords_array = [ multipoly [ 'coordinates' ] ] if multipoly [ 'type' ] == "MultiPolygon" else multipoly [ 'coordinates' ] for coords in coords_array : if _point_in_polygon ( point , coords ) : return True return False
python code to validate whether a location is within a geo json polygon
valid whether the point is located in a mulitpolygon ( donut polygon is not supported )
def point_in_multipolygon(point, multipoly):
    """
    valid whether the point is located in a mulitpolygon (donut polygon is not supported)

    Keyword arguments:
    point      -- point geojson object
    multipoly  -- multipolygon geojson object

    if(point inside multipoly) return true else false
    """
    coords_array = [multipoly['coordinates']] if multipoly[
        'type'] == "MultiPolygon" else multipoly['coordinates']

    for coords in coords_array:
        if _point_in_polygon(point, coords):
            return True

    return False