[OSM-dev] Opening hours

Roland Olbricht roland.olbricht at gmx.de
Thu May 6 14:55:22 BST 2010


> The rough plan is that my site become essentially a validation layer
> for producing the opening_hours tag and a service for getting the
> current state of a element. I'd use the OSM oauth for authentication.
[..]
> Let me know if you're interested in helping or have any advice.

> I've had a good read of this wiki page and discussion, it seems very
> sensible to me. http://wiki.openstreetmap.org/wiki/Opening_hours
 
The syntax for opening hours still has its difficulties: try to express that a 
service is open from October to March only at the weekend and all days during 
the summer. Or a service that is open on the evenings _before_ public 
holidays. It's just not possible.

On the other hand, a line like "Mo-Fr 09:00-12:00; Tu 14:00-17:00" may read
- on Tuesdays also in the afternoon  or
- on Tuesdays only in the afternoon.
While the former is far more common, the latter is what the current syntax 
defines.

Even worse, what about "Mo-We 09:00-12:00; Tu-Fr 14:00-17:00" or
"Mo-Sa 09:00-12:00; We-Fr 14:00-17:00"?

I'd rather suggest a syntax like

Month Day_of_Week Modificator From-To[,From-To]* ;]*

where
- "Month" is in (Jan, .., Dec) or a range or empty
- "Day_of_Week" is in (Mo, .., Su) or a range or empty
- "Modificator" is one of WD (working day), SD (school day), SH (school 
holiday), PH (public holiday), PH- (day before PH) or empty
- "From", "To" are times HH:MM
and intersections between days (e.g. "Mo-Fr ..; Tu ..") are considered as 
syntax error.

This would be much more concise yet were more versatile. And 90% of all 
existing opening hour data remain valid.

Cheers,

Roland




More information about the dev mailing list