1483fd50a44c29b1da75da3fd1d37461400f488b,osmnx/simplification.py,,_consolidate_intersections_rebuild_graph,#Any#Any#Any#,428

Before Change


    // STEP 7
    // for every group of merged nodes with more than 1 node in it, extend the
    // edge geometries to reach the new node point
    new_edges = utils_graph.graph_to_gdfs(H, nodes=False).reset_index()
    for cluster_label, nodes_subset in groups:

        // but only if there were multiple nodes merged together,
        // otherwise it"s the same old edge as in original graph
        if len(nodes_subset) > 1:

            // get coords of merged nodes point centroid to prepend or
            // append to the old edge geom"s coords
            x = H.nodes[cluster_label]["x"]
            y = H.nodes[cluster_label]["y"]
            xy = [(x, y)]

            // for each edge incident to this new merged node, update
            // its geometry to extend to/from the new node"s point coords
            mask = (new_edges["u"] == cluster_label) | (new_edges["v"] == cluster_label)
            for u, v, k in new_edges.loc[mask, ["u", "v", "key"]].values:
                old_coords = list(H.edges[u, v, k]["geometry"].coords)
                new_coords = xy + old_coords if cluster_label == u else old_coords + xy
                new_geom = LineString(new_coords)

After Change


            // for each edge incident to this new merged node, update its
            // geometry to extend to/from the new node"s point coords
            in_edges = set(H.in_edges(cluster_label, keys=True))
            out_edges = set(H.out_edges(cluster_label, keys=True))
            for u, v, k in in_edges | out_edges:
                old_coords = list(H.edges[u, v, k]["geometry"].coords)
                new_coords = xy + old_coords if cluster_label == u else old_coords + xy
                new_geom = LineString(new_coords)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: gboeing/osmnx
Commit Name: 1483fd50a44c29b1da75da3fd1d37461400f488b
Time: 2020-12-02
Author: boeing@usc.edu
File Name: osmnx/simplification.py
Class Name:
Method Name: _consolidate_intersections_rebuild_graph


Project Name: WZBSocialScienceCenter/tmtoolkit
Commit Name: 9def69a805132ff7549744b5b30a2fa7531fa405
Time: 2019-06-12
Author: markus.konrad@wzb.eu
File Name: tmtoolkit/preprocess/_tmpreproc.py
Class Name: TMPreproc
Method Name: load_tokens_dataframe


Project Name: gboeing/osmnx
Commit Name: 09ba9412b4f696f95befc2fd02599ceb53b66071
Time: 2020-11-18
Author: boeing@usc.edu
File Name: osmnx/simplification.py
Class Name:
Method Name: _consolidate_intersections_rebuild_graph