Skip to content

Commit

Permalink
Merge pull request #33 from mhearne-usgs/distancefix
Browse files Browse the repository at this point in the history
Now comparing earthquake location to nearest point on shape rather th…
  • Loading branch information
emthompson-usgs authored Sep 25, 2018
2 parents a243923 + c1ef10c commit 670bdc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion strec/gmreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _get_nearest_point(point, shape):
mindist = 99999999999999999999
for pshape in shapelist:
pshape_string = LineString(pshape.exterior)
point_nearest, shape_nearest = nearest_points(ppoint, pshape_string)
point_nearest, shape_nearest = nearest_points(ppoint, pshape)
distance = np.sqrt(shape_nearest.x**2 + shape_nearest.y**2) / 1000
if distance < mindist:
mindist = distance
Expand Down

0 comments on commit 670bdc2

Please sign in to comment.