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

Skip to content

Commit 73c893b

Browse files
committed
gpxelevations -- add smoothing option
1 parent 62b6244 commit 73c893b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gpxelevations

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ parser.add_argument('-o', '--overwrite', action='store_true', default=False,
1616
help='Overwrite existing elevations (otherwise will add elevations only where not yet presetn)')
1717
parser.add_argument('-p', '--approximate', action='store_true', default=False,
1818
help='Overwrite existing elevations (otherwise will add elevations only where not yet presetn)')
19+
parser.add_argument('-s', '--smooth', action='store_true', default=False,
20+
help='Smooth elevations')
1921
parser.add_argument('-c', '--calculate', action='store_true', default=False,
2022
help='Calculate elevations (but don\'t change the GPX file')
2123
parser.add_argument('-f', '--file', default=None, type=str,
@@ -57,6 +59,12 @@ for gpx_file in args.gpx_files:
5759
gpx = mod_gpxpy.parse(f.read())
5860
update_gpx(gpx)
5961

62+
if args.smooth:
63+
print 'Smoothing...'
64+
gpx.smooth(vertical=True, horizontal=False)
65+
gpx.smooth(vertical=True, horizontal=False)
66+
print 'Smoothing... done'
67+
6068
file_name = args.file
6169
if not file_name:
6270
if '.gpx' in gpx_file.lower():

0 commit comments

Comments
 (0)