@@ -14,6 +14,8 @@ parser = mod_argparse.ArgumentParser(
14
14
15
15
parser .add_argument ('-o' , '--overwrite' , action = 'store_true' , default = False ,
16
16
help = 'Overwrite existing elevations (otherwise will add elevations only where not yet presetn)' )
17
+ parser .add_argument ('-p' , '--approximate' , action = 'store_true' , default = False ,
18
+ help = 'Overwrite existing elevations (otherwise will add elevations only where not yet presetn)' )
17
19
parser .add_argument ('-c' , '--calculate' , action = 'store_true' , default = False ,
18
20
help = 'Calculate elevations (but don\' t change the GPX file' )
19
21
parser .add_argument ('-f' , '--file' , default = None , type = str ,
@@ -32,12 +34,12 @@ geo_elevation_data = mod_srtm.get_data()
32
34
33
35
def update_point (point , args ):
34
36
if args .calculate :
35
- calculated = geo_elevation_data .get_elevation (point .latitude , point .longitude )
37
+ calculated = geo_elevation_data .get_elevation (point .latitude , point .longitude , approximate = args . approximate )
36
38
print '(%s, %s) currently: %s, calculated: %s' % (point .latitude , point .longitude , point .elevation , calculated )
37
39
elif args .overwrite or point .elevation == None :
38
- calculated = geo_elevation_data .get_elevation (point .latitude , point .longitude )
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 )
39
42
point .elevation = calculated
40
- print '(%s, %s) -> %s' % (point .latitude , point .longitude , calculated )
41
43
else :
42
44
print '(%s, %s) left with %s' % (point .latitude , point .longitude , point .elevation )
43
45
0 commit comments