gregrs-uk / python-fhrs-osm

Python tools and Leaflet maps for downloading, comparing and visualising Food Hygiene Rating Scheme (FHRS) and OpenStreetMap data
http://gregrs.dev.openstreetmap.org/fhrs/
GNU General Public License v3.0
8 stars 2 forks source link

Kingston upon Thames is missing #41

Closed AndrewHain closed 7 years ago

AndrewHain commented 7 years ago

There is no longer an entry for Kingston upon Thames on the index page and http://gregrs.dev.openstreetmap.org/fhrs/district-199.html is a dead link.

gregrs-uk commented 7 years ago

Looks like the page for Kingston upon Thames isn't being created because there are only 2 FHRS establishments being marked as within the boundary for Boundary Line district 199:

select count("FHRSID") from fhrs_establishments
where district_id = 199;
 count
-------
     2
(1 row)

This shows that most of the establishments from the 'Kingston-Upon-Thames' FHRS authority are located within Boundary Line district 217 (Sutton)...

select count("FHRSID"), district_id, name from fhrs_establishments
left join districts on fhrs_establishments.district_id = districts.gid
where "LocalAuthorityCode" = 521
group by district_id,name;
 count | district_id |               name
-------+-------------+-----------------------------------
    27 |             |
   747 |         217 | Sutton London Boro
     3 |         219 | Merton London Boro
     1 |         200 | Croydon London Boro
     1 |         176 | Reigate and Banstead District (B)
(5 rows)

I'm not sure why there are only 2 establishments within the Kingston upon Thames Boundary Line district though. I presume this wasn't the case before...

gregrs-uk commented 7 years ago

The change happened between 20 Dec and 21 Dec. In the former, there were 1153 FHRS establishments within Boundary Line district 199 (Kingston upon Thames), and there are now only 2.

Looks like the 177 OSM entities that were matched are now mismatched, indicating that they've probably just disappeared from the FHRS database for some reason.

select status, count(osm_id) from compare where osm_district_id = 199 group by status;
      status       | count
-------------------+-------
 mismatch          |   179
 OSM_no_postcode   |   206
 OSM_with_postcode |    25
(3 rows)

Closing because I don't think it's a bug, but rather missing FHRS data.