Skip to content

Commit 10e70dd

Browse files
Compare: Use distance between nodes to calculate the node distance
1 parent 15404e9 commit 10e70dd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

yaramo/operations/compare.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,9 @@ def _calc_distance_for_matching(
243243
if element_type == "node":
244244
if exclude_ends_in_calculation and not element_a.is_point():
245245
continue
246-
start_geo_node_a = start_node_a.geo_node
247-
start_geo_node_b = start_node_b.geo_node
248246
geo_node_a: GeoNode = element_a.geo_node
249247
geo_node_b: GeoNode = element_b.geo_node
250-
distance = abs(
251-
start_geo_node_a.get_distance_to_other_geo_node(geo_node_a)
252-
- start_geo_node_b.get_distance_to_other_geo_node(geo_node_b)
253-
)
248+
distance = abs(geo_node_a.get_distance_to_other_geo_node(geo_node_b))
254249
print(f"From {element_a.uuid} to {element_b.uuid}: {distance}")
255250
distance_sum += distance
256251
elif element_type == "edge":

0 commit comments

Comments
 (0)