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])
utils.log(f"Found nearest edge ({u, v, key}) to point {point}")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
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: bethgelab/foolbox
Commit Name: 80cfb0e5f889c65a972ebde6c6dae4278b5e28c1
Time: 2020-02-14
Author: git@jonasrauber.de
File Name: foolbox/attacks/base.py
Class Name: MinimizationAttack
Method Name: __call__