OSMNX - Incomplete network

391 views Asked by At

I'm trying to retrieve the rail and subway network of a city. In OSM, I checked that each station was properly tagged, but when I run my code, there are some missing stations, as well as part of the track (both stations and track on the west side of the subway line).

ox.config(use_cache=False,
      log_console=True,
      useful_tags_way=ox.settings.useful_tags_way + ['public_transport', 'railway'],
      useful_tags_node=ox.settings.useful_tags_node + ['public_transport', 'railway','highway','ref'])

cf='["railway"~"rail|subway|station"]'
graph=ox.graph_from_place('Turin,Italy', retain_all = True, custom_filter=cf)
nod, edg=ox.utils_graph.graph_to_gdfs(graph)

I also tried with other cities with available data, but it still does not retrieve the whole network.

SOLVED:

Now I use:

graph=ox.graph_from_place(city, retain_all = True, custom_filter=cf, simplify=False)

Moreover, I get nodes rapresenting station by using a specfic command:

st=ox.geometries_from_place(city, tags=tag)
0

There are 0 answers