[OSM-talk] An old question about GPX traces

Tom Carden tom at tom-carden.co.uk
Wed Sep 13 22:55:43 BST 2006


On 13/09/06, matthew-osm at newtoncomputing.co.uk
<matthew-osm at newtoncomputing.co.uk> wrote:
> On Wed, Sep 13, 2006 at 10:34:22PM +0200, Joerg Ostertag (OSM Munich/Germany) wrote:
> > >   sed -e 's/\(<trkpt[^>]\+>\)/\1<time>2006-01-01T00:00:00.000Z<\/time>/' \
> > >     withouttime.gpx > withtime.gpx
> >
> > or
> >   osmfilter.pl <filename.gpx>
> > ;-)
>
> OK... I knew there was probably already a way of doing this :-).
>
> Can osmfilter also randomise time data for you? I currently run the following
> script but it would be nice to use a more common method.
>
> #! /usr/bin/perl
> $time = (time()-(2**21)) + int(rand()*2**22);
> while (<>) { @t = gmtime($time);
>   $o = sprintf '%4d-%02d-%02dT%02d:%02d:%02dZ', 1900+$t[5],
>      $t[4], $t[3], $t[2], $t[1], $t[0];
>   s/<time>\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ<\/time>/<time>$o<\/time>/g;
>   print; $time += int(rand()*15)+1;
> }
>

Can anyone tell me why randomised time data would be better than all
zero time data?

Strikes me as totally stupid, and possibly even something that should
be classified as vandalism... your privacy is one thing, stepping
around OSM's over-stringent requirements is another, but submitting
junk data is just harmful.

Tom.




More information about the talk mailing list