def get_high_and_water_ways(ways):
    """
    Extracts highways and waterways from all ways. 
    :param ways: All ways as a dict
    :return: highways (list), waterways (list)
    """
    highways = list()
    waterways = list()
    for way_id in ways:
        way = ways[way_id]
        if "highway" in way.tags:
            highways.append(way)
        elif "waterway" in way.tags:
            waterways.append(way)
    return highways, waterways