def get_polys_from_osm(osm_data, limit=None):
    """Get polygons from Open Street Map data.

    Args:
        osm_data: Open Street Map data

    Returns:
        List of polygons
    """
    polys = []
    counter = 1
    for result in osm_data:
        if (limit is None or limit >= counter) and 'polygon' in result['geojson']['type'].lower():
            counter += 1
            for p in result['geojson']['coordinates']:
                if isinstance(p[0][0], list):
                    for p2 in p:
                        polys.append([[float(point[0]), float(point[1]), float(osm_data[0]['importance'])] for point in p2])
                else:
                    polys.append([[float(point[0]), float(point[1]), float(osm_data[0]['importance'])] for point in p])
    return polys