Skip to content

Commit

Permalink
Utilize the util.compute_length() instead of calculating independen…
Browse files Browse the repository at this point in the history
…tly.
  • Loading branch information
James Gaboardi committed Mar 3, 2017
1 parent 90cf499 commit 07b626c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pysal/network/network.py
Expand Up @@ -709,9 +709,8 @@ def allneighbordistances(self, sourcepattern, destpattern=None, fill_diagonal=No
if set1 == set2: # same edge
x1,y1 = sourcepattern.snapped_coordinates[p1]
x2,y2 = destpattern.snapped_coordinates[p2]
xd = x1-x2
yd = y1-y2
nearest[p1,p2] = np.sqrt(xd*xd + yd*yd)
computed_length = util.compute_length((x1,y1),(x2,y2))
nearest[p1,p2] = computed_length

else:
ddist1, ddist2 = dest_dist_to_node[p2].values()
Expand Down

0 comments on commit 07b626c

Please sign in to comment.