[Python] Bus lines/routes from OpenStreetMap using OSMnx

Discussão em 'Python' iniciado por Stack, Março 7, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to obtain bus lines/routes from OpenStreetMap using OSMnx. For example busline 284 in Nootdorp, Netherlands: https://www.openstreetmap.org/relation/2024408#map=15/52.0463/4.3967&layers=T

    How do I obtain the exact route (i.e. as a list of nodes) as shown in OSM?

    I tried using osmnx.features.features_from_place:

    import osmnx as ox

    gdf_busline = ox.features.features_from_place("Nootdorp, Netherlands", tags={'type': 'route', 'route': 'bus'})

    print(gdf_busline)


    But it returns an Empty Dataframe. (I also tried a some other combinations of tags, but no success)

    Continue reading...

Compartilhe esta Página