NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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%


You might find your answer in this previous question :

http://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).

permanent link

answered 13 Sep '11, 15:17

Pieren's gravatar image

Pieren
9.8k2083157
accept rate: 15%

edited 13 Sep '11, 15:55

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".

permanent link

answered 13 Sep '11, 15:47

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

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

permanent link

answered 19 Sep '11, 13:16

kami's gravatar image

kami
1111
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×255
×35
×9
×8

question asked: 13 Sep '11, 13:42

question was seen: 13,085 times

last updated: 19 Sep '11, 13:16

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum