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

Before Change


    xy_point = Point(reversed(point))

    // calculate euclidean distance from each edge"s geometry to this point
    edge_distances = [(edge, xy_point.distance(edge[3])) for edge in edges]

    // the nearest edge minimizes the distance to the point
    (u, v, key, geom), dist = min(edge_distances, key=lambda x: x[1])

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: 9c1f289b1dce08abf5577319046f00de640393aa
Time: 2019-02-12
Author: bauer@cbs.tu-darmstadt.de
File Name: src/biotite/structure/rdf.py
Class Name:
Method Name: rdf