UK Food Hygiene Rating System

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

The UK Food Hygiene Rating System data contains information for thousands of business 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.

Licensing

Data from the UK Food Safety Agency's Food Hygiene Rating Scheme are licensed under the Open Government License.

In licensing terms it seems 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).

Comparison tool

Map screenshot
Screenshot of the FHRS/OSM comparison tool

User:Gregrs has developed a tool for comparing Food Hygiene Rating Scheme (FHRS) and OSM data and finding possible matches between it, with an emphasis on the fhrs:id=* and addr:postcode=* tags. It is also possible to download GPX files to assist in surveying. The code is freely available on GitHub

Autumn Quarterly Project 2016

Using FHRS data to improve OpenStreetMap data was the focus of the UK_2016_Q4_Project:_Food_Hygiene_Ratings.

Download

Raw data can be downloaded from ratings.food.gov.uk or using the API e.g. using python-fhrs-osm.

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.

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.