This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Changing timestamp for gpx file

0

Hi,

i am just trying to change the timestamp for a gpx-file. I import an nmea-file without an date value. So i added the date value with this command:

gpsbabel -i nmea,date="'.$final_date.'" -f "'.$imgfile_tmp.'" -x track,pack,split=4m,title="Track-%d%m%Y-%H%M%S" -o gpx -F "'.$imgfile_tmp.'.p"

After this procedure i split the *.p file into 2 or more gpx files.

But now after this i would like to change only the Date of the track. The Timestamps are okay but the date value is wrong. How can i do this?

Thanks a lot for the help.

Cu kami

asked 13 Sep '11, 13:42

kami's gravatar image

kami
1111
accept rate: 0%


3 Answers:

1

You might find your answer in this previous question :

https://help.openstreetmap.org/questions/2130/gpx-file-no-time-tag

especially the answer with xmlstarlet

Note that OSM doesn't require a correct date value in GPX files. Any date is accepted (in fact, it could work without timestamp but that's another story).

answered 13 Sep '11, 15:17

Pieren's gravatar image

Pieren
9.8k2083157
accept rate: 15%

edited 13 Sep '11, 15:55

0

In your case if you just want to change the same date value everywhere that it occurs in the file, a global search-and-replace with a text editor should do the trick. Just open the .gpx file with your editor of choice (even Windows notepad) and "replace all".

answered 13 Sep '11, 15:47

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

0

Hi,

thanks a lot for the answer. I used sed to change all entry in the gpx-file. works fine.

find /tmp -name "'.$imgfile.'.o" -exec sed -i 's/'1996-01-'.$timsstmp.''/''.$final_date.''/g' {} ;

Thanks a lot.

Cu kami

answered 19 Sep '11, 13:16

kami's gravatar image

kami
1111
accept rate: 0%

Source code available on GitHub .