marceloprates / prettymaps

A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries.
GNU Affero General Public License v3.0
11.14k stars 527 forks source link

Error adding railway layer #8

Open Chaz6 opened 3 years ago

Chaz6 commented 3 years ago

I added 'railway': {}' to my config, and it results in the error NotImplementedError: Multi-part geometries do not themselves provide the array interface. I have also tried 'railway': {'custom_filter': '["railway"~"rail"]'} and it gives ValueError: Found no graph nodes within the requested polygon. I have tested it without railway to ensure the output area does indeed contain a line with railway=rail.

peterdsharpe commented 3 years ago

Confirming that this same NotImplementedError error occurs when adding waterways via 'waterway': {}.

These problems seem related based on handling in get_streets(); please let me know if you find a fix!

asmunder commented 3 years ago

I've finally gotten railways to display using the custom_filter way, but only after putting a large value for dilation, e.g.

'railway':{'custom_filter': '["railway"~"rail|light_rail"]', 'dilate':2000}
Chaz6 commented 3 years ago
'railway':{'custom_filter': '["railway"~"rail|light_rail"]', 'dilate':2000}

Thank you for the suggestion! Unfortunately this did not work for me. I tried increasing the value of dilate to 4000, and it gave this error:-

networkx.exception.NetworkXPointlessConcept: Connectivity is undefined for the null graph.

henrimh commented 3 years ago

I'm just testing out the demo, and was wondering too why the railways weren't working.

I got them to work with the custom filter above, plus with dilate number 200. If it matters, my target was Riihimäki, Finland.