f727d48d75e9c313855108bd7b759d1404c70ea1,osmnx/folium.py,,plot_route_folium,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,152

Before Change


        raise ImportError("The folium package must be installed to use this optional feature.")

    // create gdf of the route edges
    gdf_edges = utils_graph.graph_to_gdfs(G.subgraph(route), nodes=False, fill_edge_geometry=True)
    route_nodes = list(zip(route[:-1], route[1:]))
    index = [
        gdf_edges[(gdf_edges["u"] == u) & (gdf_edges["v"] == v)].index[0] for u, v in route_nodes
    ]
    gdf_route_edges = gdf_edges.loc[index]

    // get route centroid
    x, y = gdf_route_edges.unary_union.centroid.xy

After Change


    // create gdf of the route edges in order
    node_pairs = zip(route[:-1], route[1:])
    uvk = ((u, v, min(G[u][v], key=G[u][v].get("length"))) for u, v in node_pairs)
    gdf_edges = utils_graph.graph_to_gdfs(G.subgraph(route), nodes=False).loc[uvk]

    // get route centroid
    x, y = gdf_edges.unary_union.centroid.xy
    route_centroid = (y[0], x[0])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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


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: 3580cddb1c8ecaf3348ec1c91d99869591ff81bf
Time: 2020-12-08
Author: boeing@usc.edu
File Name: osmnx/simplification.py
Class Name:
Method Name: consolidate_intersections