Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62b6244

Browse files
committed
gpxelevations - elevation to one decimal digit
1 parent 7329186 commit 62b6244

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

gpxelevations

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ if args.verbose:
3333
geo_elevation_data = mod_srtm.get_data()
3434

3535
def update_point(point, args):
36-
if args.calculate:
36+
if args.calculate or (args.overwrite or point.elevation == None):
3737
calculated = geo_elevation_data.get_elevation(point.latitude, point.longitude, approximate=args.approximate)
38+
if calculated and int(calculated) != calculated:
39+
calculated = int(calculated * 10) / 10.
3840
print '(%s, %s) currently: %s, calculated: %s' % (point.latitude, point.longitude, point.elevation, calculated)
39-
elif args.overwrite or point.elevation == None:
40-
calculated = geo_elevation_data.get_elevation(point.latitude, point.longitude, approximate=args.approximate)
41-
print '(%s, %s) was %s changed to %s' % (point.latitude, point.longitude, point.elevation, calculated)
42-
point.elevation = calculated
4341
else:
4442
print '(%s, %s) left with %s' % (point.latitude, point.longitude, point.elevation)
4543

0 commit comments

Comments
 (0)