cb357e90338afa0e482a25531b501d25f39c42ce,osmnx/plot.py,,plot_figure_ground,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,620

Before Change


        G = get_largest_component(G, strongly=True)
        center_nodes = nx.center(G)
        // Bad performance [(node, data) for node, data in G.nodes(data=True) if node in nx.center(G)]
        nodes_data = {node: data for node, data in G.nodes(data=True)}
        // Arbitrarily choose first node
        point = (nodes_data[center_nodes[0]]["y"], nodes_data[center_nodes[0]]["x"])

After Change


    
    // if G was passed-in, use this graph in the plot, centered on the centroid of its nodes
    if G is not None:
        gdf_nodes = graph_to_gdfs(G, edges=False, node_geometry=True)
        lnglat_point = gdf_nodes.unary_union.centroid.coords[0]
        point = tuple(reversed(lnglat_point))
    
    // otherwise, get the network by either address or point, whichever was passed-in, 
    // using a distance multiplier to make sure we get more than enough network
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: gboeing/osmnx
Commit Name: cb357e90338afa0e482a25531b501d25f39c42ce
Time: 2017-03-02
Author: gboeing@berkeley.edu
File Name: osmnx/plot.py
Class Name:
Method Name: plot_figure_ground


Project Name: gboeing/osmnx
Commit Name: 56000b4ac3808e10ee064125978347375fecba8a
Time: 2020-11-18
Author: boeing@usc.edu
File Name: osmnx/folium.py
Class Name:
Method Name: plot_route_folium


Project Name: gboeing/osmnx
Commit Name: f727d48d75e9c313855108bd7b759d1404c70ea1
Time: 2020-12-02
Author: boeing@usc.edu
File Name: osmnx/folium.py
Class Name:
Method Name: plot_route_folium