Find facilities which are missing an opening_hours tag but have a website tag

Posted by ypid on 8 September 2014 in English (English)

I recently played a bit with the Overpass API, mainly to finally solve issue number 1 of the opening_hours_map. So I read the Overpass QL wiki page a few times and tried it. After a certain learning curve I now have understood all the basics of it. I have to say, if you work with OSM, knowing the overpass API and the ability to query for arbitrary constellations is a big advantage.

A couple of days after fixing the initial problem I thought about another use case. Since I have been working with opening_hours for some time now I came up with the idea of a query which shows facilities for which opening_hours could easily be added ;) So if your area looks all shiny on the opening_hours_map try running one of those queries ;)

The queries use a relatively new feature of the overpass API to search over keys with regular expressions: See issue 59.

Shameless self plug: If you do not know the evaluation tool yet, I would recommend to check it out since it makes this task so much easier. Just copy the opening hours from the website (check this blog post for how to find them quickly), add a few semicolons or other rule separators, copy the prettified value over to your editor and you are done …

So, lets add those missing opening_hours ;)

Comment from Harald Hartmann on 9 September 2014 at 05:51

Awesome work. Glad to see my region is already clean :)

Comment from kerosin on 9 September 2014 at 10:44

Good job, thanks! added a lot in my region!

Some things I excluded for my queries: - hospital - fire_station - social_facility - kindergarten - school - college

Comment from hfs on 9 September 2014 at 11:25

This could be a nice “Wochenaufgabe”.

Comment from ypid on 9 September 2014 at 15:44

@kerosin: Could you share your query, please? ;)

This could be a nice “Wochenaufgabe”.

All ready thought about that ;) See German OSM Forum.

Comment from mmd on 9 September 2014 at 17:11

I’d propose a slightly modified query to allow an “Export to JOSM” from overpass turbo:


  • Output format: XML instead of JSON
  • Recurse ways to nodes + output with meta information

Comment from ypid on 9 September 2014 at 19:34

Thanks. I agree with your changes and updated the blog post accordingly.

Comment from kerosin on 10 September 2014 at 07:56

@ypid here (the query might be very inefficient, I’m not that familiar with Overpass QL)

There might be several other Tags like bench,bbq,waste_disposal and so on that might not have opening times. The one in the query were just some that I filtered out in my region.

Comment from ypid on 10 September 2014 at 11:25

The intention of this query is to find objects for which opening_hours can easily be added so it makes sense to exclude amenity=bbq and others since they are either open 24/7 or there “opening hours” are not on the website.

Thanks. I updated the query.

Comment from mmd on 11 September 2014 at 09:17

I added this example to the Overpass API Examples page for everyone to edit/further enhance as needed.

Don’t worry, it’s in German right now. Feel free to edit the query and add some comments in English if you like.

Comment from AndiG88 on 11 September 2014 at 10:48

Btw. is also a great map if you want to find missing opening hours.

Comment from MKnight on 15 September 2014 at 09:36

Thx for the query.

Have added kindergarten concert_hall retirement_home for excluding. Think will be find some other stuff to exclude ;)

Comment from ypid on 15 September 2014 at 22:18

Thanks, added kindergarten to the more comprehensive (second) query.

I created a simplified query which should be tried first to get better results.


I agree that it is probably the best to maintain those queries in the wiki so I deleted them in my blog post.

Login to leave a comment