[OSM-dev] OSM Date Formats

Jon Burgess jburgess777 at googlemail.com
Sun Sep 30 14:45:42 BST 2007

On Sun, 2007-09-30 at 15:01 +1000, Brett Henderson wrote:
> Jon Burgess wrote:
> > Only 3 different formats. The ruby date/format.rb code tries to parse 11
> > different formats. Parsing date/time strings is a big pain.
> >   
> Yeah actually it's a lot more than 3.  The JOSM parser which is my final 
> fallback handles about 13 formats (I suspect many of which could be 
> eliminated with the use of XmlGregorianCalendar).
> > If we want to avoid an enormous planetdiff file for the transition then
> > I'll need to enhance it to parse the formats instead of treating them as
> > strings. 
> >   
> I didn't think of that.  Hopefully parsing dates in C is faster than 
> java, when reading a planet the cpu consumption for date parsing in 
> osmosis dwarfs everything else including the SAX parser hence my desire 
> to optimise it as much as possible.

I've implemented a change in planetdiff for this. I ignore the contents
of the timestamp field when comparing objects. If the only difference
between 2 objects is the timestamp then it isn't especially interesting
to include in the diff anyway. It seems that there are a reasonable
number of objects which fall into this category in the current diffs so
it should slightly reduce the diff sizes.

> It may be possible to check the format before parsing and only parse it 
> if it's not in the "standard" format.  Over time the majority of data 
> will come to use the new format and date parsing can be avoided.
> I'll fix osmosis to remove the millisecond information.  Are you willing 
> to update planet.c and planetdiff?  I can brush off my C skillz but it 
> will probably take me a while :-)

No problem. Planetdiff should be covered by the changes above. I'll take
a look at updating the planet.c code as well.


More information about the dev mailing list