0

I tried to download shapefiles of some cities and calculate their 'street_length_avg' by OSMnx, but found some error about nodes of Linzhi City, Xizang, China:

Road network 1 of Linzhi City, Xizang, China Road network 2 of Linzhi City, Xizang, China

As shown in figures,I found that nodes on a long road have not been properly simplified,which will lead to the incorrect calculations of ‘street_length_avg’(46.62, less than any city in China)

Statistical data of Linzhi City, Xizang, China

But at the same time, the calculated value of the road network (like Shanghai,China) with more intersections is normal.

Statistical data of Shanghai,China

Is there something wrong with my operation? Here are my code:

G6 = ox.graph_from_place('Linzhi City, Xizang, China')
ox.save_graphml(G6, filename=("林芝市" + '.graphml'), folder="F:/python_code/data/", gephi=False)
ox.save_graph_shapefile(G6, filename=("林芝市" + '.shp'), 
folder="F:/python_code/data/cityshapefile/")
stats =ox.basic_stats(G6)
print(str(stats['street_length_avg']))
fig, ax = ox.plot_graph(G6)
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • I'm getting a very [different graph](https://imgur.com/a/eonqGRd) than you did when I run your code, so it's tough to troubleshoot exactly what you were seeing. – gboeing May 04 '20 at 18:04
  • If you can reproduce this issue, please open an issue in the OSMnx Github repo: https://github.com/gboeing/osmnx/issues – gboeing May 05 '20 at 00:34

0 Answers0