[OSM-dev] OSM Date Formats

Brett Henderson brett at bretth.com
Sun Sep 30 06:01:09 BST 2007


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.

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 :-)





More information about the dev mailing list