UK Food Hygiene Rating Scheme

From OpenStreetMap Wiki
Jump to navigation Jump to search
Linking Food Hygiene Open Data to OSM highways

The United Kingdom Food Standards Agency's Food Hygiene Rating Scheme data contains information for thousands of businesses across the United Kingdom. The system is called the Food Hygiene Rating Scheme (FHRS) in England, Northern Ireland, and Wales and the Food Hygiene Information Scheme (FHIS) in Scotland.

Licencing

Data from the UK Food Safety Agency's Food are licensed under the Open Government Licence. [1]

In licensing terms, this is a dataset we can make use of, and they have already been listed as credited Contributors (although the license is not the only consideration; because of #Location Inaccuracy problems described below, this is not a candidate dataset for direct import into OpenStreetMap).

FHODOT (online tool)

Map screenshot
Screenshot of FHODOT

User:Gregrs has developed FHODOT (food hygiene open data OpenStreetMap tool) to allow mappers to make efficient use of FHRS data, particularly through interaction with JOSM. More information and the source code is freely available on GitHub.

JOSM Plugin

Another way of using FHRS Data in JOSM is with User:Kmpoppe's fhrsPlugin, which can be activated directly in the Plugin-settings of JOSM.

Statistics

Statistics relating to the use of FHRS data in OpenStreetMap can be found on this page.

UK Quarterly Projects

FHRS data was the focus of the UK 2016 Q4 Project: Food Hygiene Ratings, and the UK 2019 Q1 Project: Food Hygiene Ratings.

Download

Raw data can be downloaded from ratings.food.gov.uk or using the API e.g. using the Python code from FHODOT.

Example data

    <EstablishmentDetail>
      <FHRSID>207603</FHRSID>
      <LocalAuthorityBusinessID>2006/00077/COMM</LocalAuthorityBusinessID>
      <BusinessName>Starbucks Coffee Company</BusinessName>
      <BusinessType>Restaurant/Cafe/Canteen</BusinessType>
      <BusinessTypeID>1</BusinessTypeID>
      <AddressLine1>Unit 6</AddressLine1>
      <AddressLine2>Block 4</AddressLine2>
      <AddressLine3>Jubilee Street</AddressLine3>
      <AddressLine4>Brighton</AddressLine4>
      <PostCode>BN1 1GE</PostCode>
      <RatingValue>5</RatingValue>
      <RatingKey>fhrs_5_en-GB</RatingKey>
      <RatingDate>2011-08-11</RatingDate>
      <LocalAuthorityCode>875</LocalAuthorityCode>
      <LocalAuthorityName>Brighton and Hove</LocalAuthorityName>
      <LocalAuthorityWebSite>http://www.brighton-hove.gov.uk/foodsafety</LocalAuthorityWebSite>
      <LocalAuthorityEmailAddress>ehl.food@brighton-hove.gov.uk</LocalAuthorityEmailAddress>
      <Scores>
        <Hygiene>0</Hygiene>
        <Structural>5</Structural>
        <ConfidenceInManagement>5</ConfidenceInManagement>
      <Scores/>
      <SchemeType>FHRS</SchemeType>
      <Geocode>
        <Longitude>50.82486600000000</Longitude>
        <Latitude>-0.13894300000000</Latitude>
      </Geocode>
    </EstablishmentDetail>

This is equivalent to node:1236329881.

From this data, the following can be merged into OpenStreetMap:

  • BusinessName → name
  • BusinessType can be used to infer amenity or shopping or tourism or a number of other values.
  • AddressLine* → addr:housenumber, addr:street, addr:city
  • PostCode → addr:postcode

The following tags are currently in use for FHRS specific data:

It is not recommended to store ephemeral data relating to ratings in OSM as this can be fetched using the FHRS API if the fhrs:id=* tag is set, but the following tags have been used by some mappers:

The key fhrs:inspectiondate is also used as an alternative to fhrs:rating_date, although the latter is more widely used.

The Geocode property can be used as a way to distinguish between similarly named businesses (chains with a lot of locations like McDonalds, Starbucks etc.) and to add points of interest that do not exist.

Location Inaccuracy

It looks like the Latitude and Longitude coordinates of each place are the approximate location of the place based on postcode. As an example, all these places have the same coordinates (-0.12234400000000 51.58105100000000) and postcode (N8 8PT), but in fact they are scattered around the street:

Belash	Restaurant/Cafe/Canteen	5	N8 8PT	-0.12234400000000	51.58105100000000
Bistro Aix	Restaurant/Cafe/Canteen	4	N8 8PT	-0.12234400000000	51.58105100000000
Broadway Fish Bar	Restaurant/Cafe/Canteen	2	N8 8PT	-0.12234400000000	51.58105100000000
Dixy Chicken	Restaurant/Cafe/Canteen	4	N8 8PT	-0.12234400000000	51.58105100000000
Honeycomb Cafe	Retailers - other	3	N8 8PT	-0.12234400000000	51.58105100000000
Meghna Restaurant	Restaurant/Cafe/Canteen	1	N8 8PT	-0.12234400000000	51.58105100000000
Melange Restaurants Ltd	Restaurant/Cafe/Canteen	3	N8 8PT	-0.12234400000000	51.58105100000000
Nakama	Restaurant/Cafe/Canteen	1	N8 8PT	-0.12234400000000	51.58105100000000
Papaya	Restaurant/Cafe/Canteen	4	N8 8PT	-0.12234400000000	51.58105100000000
Pizza Hut Delivery	Takeaway/sandwich shop	5	N8 8PT	-0.12234400000000	51.58105100000000
Royal News	Retailers - other	4	N8 8PT	-0.12234400000000	51.58105100000000
The Henry Reader	Pub/bar/nightclub	3	N8 8PT	-0.12234400000000	51.58105100000000
Virgin Active	Restaurant/Cafe/Canteen	4	N8 8PT	-0.12234400000000	51.58105100000000

This suggests that the location data might be sourced by a postcode lookup and as such is slightly worrying license-wise. It might be an idea to avoid using the coordinate information directly.

Multiple food hygiene ratings for a location

A recent trend for pubs is to put their food business out to a third party. This means that the Food Standards Agency has records for:

  • the pub "wet sales"
  • the kitchen franchise

We even found a pub that has a different franchisee for Sunday lunches, so has three fhrs:ids.

As OSM is a map of ground truth we wouldn't create an extra location for the kitchen. The pub serves the food, we can't distinguish between their franchise arrangements. The multiple fhrs:ids should be an attribute on the pub point or polygon, entered with a semi-colon separator.

e.g. The Dover Castle, Southover Street, Brighton. fhrs:id 803241;920143

It's not so different from the church hall which has it's own fhrs entry, but separate ones for the playgroup & the Wednesday OAP lunch club; or the school with entries for breakfast & after-school clubs.

Welsh language

For local authorities in Wales, the data is provided in two XML files, containing both English and Welsh place text strings.

Helper script

User:robert has posted his fhrs2osm script for converting a FHRS XML file into a .osm file suitable for loading into JOSM. The intention is for this to be loaded as a separate layer and for very selective merging to be done through copy/pasting of tags, not for the resulting .osm file to be uploaded.

Mobile Apps

The Food Standards Agency deliberately does not provide its own mobile app. They have decided that the public are better served by publishing Open Data and enabling private business to create apps such as https://play.google.com/store/apps/details?id=com.sotd.foodhygiene and https://play.google.com/store/apps/details?id=com.pigdogbay.foodhygieneratings Whether any of these then leverage the improved geolocation via OSM is another matter.

  1. Food.gov Crown Copyright https://www.food.gov.uk/crown-copyright retrieved: 10 Sept 2019