[Python] How to retrieve relations of type `route=bicycle` with OSMNX?

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

  1. Stack

    Stack Membro Participativo

    I would like to extract several bike touring routes from OpenStreetMap using the OSMNX package. For example, this bike route has the property type=route and route=bicycle. However since they are Relations and not Ways, I cannot use the functions in the OSMNX Features module:

    Is there a different way to extract this data ?

    My attempt using the Features module:

    import osmnx as ox
    ox.__version__ # '1.5.1'

    tags = {"route": "bicycle"}
    gdfox = ox.features_from_place("Charente-Maritime", tags)
    gdfox.shape # (0,0)

    Continue reading...

Compartilhe esta Página