79172407

Date: 2024-11-09 08:58:56
Score: 0.5
Natty:
Report link

ox.plot.plot_footprints plots polygons and multipolygons whereas osm restaurant amenities are points. When one plots the latter with a straight geopandas.plot() all seems to work fine -- see working example below

    fig, ax = plt.subplots(figsize=(10,10),dpi=120)
    place = 'centrum, Rotterdam,Netherlands'

    amenity = ox.features.features_from_place(place, tags={'amenity':'restaurant'})
    roads = ox.graph.graph_from_address(place)
    buildings = ox.features_from_place(place, tags = {"building": True})


    ox.plot.plot_footprints(buildings, ax=ax,color='red',edge_color='green',edge_linewidth=1,show=False, close=False) 
    ox.plot.plot_graph(roads, ax=ax, node_color='#696969', node_size = 5, edge_color='#A9A9A9', show=False, close=False)  
    gdf.plot(amenity,ax=ax,color='blue')

    plt.show()
``
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: anon