I'm using OSmnx to create some nice maps where I color streets based on the name of the street, inspired by puntofisso (eg: if it's a street, it needs to be red, a lane is green, etc). I noticed that sometimes the name of an edge is not a string, but a list instead. I worked around that so far, but is there an argument that could solve this? Or is it caused by something in OpenStreetMap? I was unsuccessful in googling for answers unfortunately.
test_place='Kerkstraat, Delft'
# Create a graph around this address
G3 = ox.graph_from_address(test_place, network_type='all',dist=100, dist_type='bbox')
edge_attributes3 = ox.graph_to_gdfs(G3, nodes=False)
edge_attributes3.head(50)
This gives [Markt, Kerkstraat] in the name column in the row with index 2.
My solution now just takes the first element of the list, but I wanted to find the Kerkstraat in Delft and it turns out that the Kerkstraat only occurs in edges that have a list for their name.
Any help is greatly appreciated!
question from:
https://stackoverflow.com/questions/65545458/the-osmnx-python-graph-to-gdfs-sometimes-returns-a-list-in-the-name-column-what 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…