Skip to content

Commit

Permalink
Fill elevation only if not None
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrajina committed Jul 1, 2018
1 parent 0522f35 commit 37fb8a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion srtm/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ def add_elevations(self, gpx, only_missing=False, smooth=False, gpx_smooth_no=0)
self._add_sampled_elevations(gpx)
else:
for point in gpx.walk(only_points=True):
point.elevation = self.get_elevation(point.latitude, point.longitude)
ele = self.get_elevation(point.latitude, point.longitude)
if ele is not None:
point.elevation = ele

for i in range(gpx_smooth_no):
gpx.smooth(vertical=True, horizontal=False)
Expand Down

0 comments on commit 37fb8a6

Please sign in to comment.