(Quick links to the data: KML or web page)
The Good Pub Guide used to have a useful section for places that you could get a nice dinner as an alternative to motorway service stations. I wondered if it was possible to do the same thing using OpenStreetMap data
Pubs (amenity=pub) can be marked in OSM as serving food (food=yes). For the moment, I'm not considering cafes or restaurants.
Motorway junctions are marked in OSM (motorway_junction=[reference number]).
To find out which motorway they're on, one needs to store the node's ID, then
look at the roads (highway=motorway) to find one that goes past the junction.
If no motorway connects to the junction, it's probably on a trunk road,
e.g. the A421.
Cities are marked in OSM (place=city) and I've removed city-centre pubs to avoid cluttering the map every time a motorway goes through a city. Also, London (capital=yes) is treated as a larger area than regular cities.
Download the KML file (45KB)
Osmium is used to parse protocol buffers extracts of OpenStreetMap data from GeoFabrik. libkml is used to generate KML output. Internal storage is currently just std::vector's
42 seconds for British Isles extract. Comparisons are all O(n²) at best :-(
Download the source code (not pretty!)
Hopefully projects such as this which give visibility to attributes such as food=yes (and website=, telephone=) should lead to an increase in interest in tagging such features.
At the moment, the choice of pubs shown may be more indicative of their proximity to a surveyor familiar with the food=yes tag than to the availability of good food.
In due course, the OpenStreetMap community may want to come up with additional attributes to distinguish between good food and adequate food, provided it can be done in an objective way (as opposed to reviewer's ratings) similar to the "real_ale" tag for classifying pubs.
~