c46a77985576103fc92ac95395f4d8410f56f029,osmnx/distance.py,,get_nearest_edge,#Any#Any#Any#Any#,168

Before Change


    
    // get u, v, key, geom from all the graph edges
    gdf_edges = utils_graph.graph_to_gdfs(G, nodes=False, fill_edge_geometry=True)
    edges = gdf_edges[["u", "v", "key", "geometry"]].values

    // convert lat,lng (y,x) point to x,y for shapely distance operation
    xy_point = Point(reversed(point))

After Change


    // calculate euclidean distance from each edge"s geometry to this point
    gs_edges = utils_graph.graph_to_gdfs(G, nodes=False)["geometry"]
    uvk_geoms = zip(gs_edges.index, gs_edges.values)
    distances = ((uvk, geom, xy_point.distance(geom)) for uvk, geom in uvk_geoms)

    // the nearest edge minimizes the distance to the point
    (u, v, key), geom, dist = min(distances, key=lambda x: x[2])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: gboeing/osmnx
Commit Name: c46a77985576103fc92ac95395f4d8410f56f029
Time: 2020-12-02
Author: boeing@usc.edu
File Name: osmnx/distance.py
Class Name:
Method Name: get_nearest_edge


Project Name: gboeing/osmnx
Commit Name: fe8f96e9981376e26984bfa4812916d14856dc05
Time: 2020-11-18
Author: boeing@usc.edu
File Name: osmnx/distance.py
Class Name:
Method Name: get_nearest_edge


Project Name: biotite-dev/biotite
Commit Name: e364579d5fe914d7dc410b4e568b216ad0928cc1
Time: 2020-05-07
Author: tom.mueller@beachouse.de
File Name: src/biotite/structure/basepairs.py
Class Name:
Method Name: _get_proximate_basepair_candidates