User:Zartbitter
From OpenStreetMap Wiki
| All my contributions to OpenStreetMap are released into the public domain. This applies worldwide. In case this is not legally possible, I grant anyone the right to use my contributions for any purpose, without any conditions, unless such conditions are required by law. |
doctor.py
Adds timestamp elements to gpx tracks without timestamp information. Needs Python installed. Found it somewhere else, don't know who's the author.
#!/usr/bin/python
import sys
infile = open(sys.argv[1],'r')
l = infile.readlines()
infile.close()
t = l[7]
ll = []
for i in range(len(l)):
ll.append(l[i])
if l[i].lstrip().startswith('<ele>'):
if not l[i+1].lstrip().startswith('<time>'):
ll.append(t)
outfile = open(sys.argv[1][:-4] + '-doc.gpx','w')
outfile.writelines(ll)
outfile.close()