The map shows how many percent of "feed-in tariff" (FIT) panels was put on the Open Street Map (OSM) for UK. It was initially created for OpenClimateFix contributors to indicate which postcode districts lack information about solar panels location.
How to use
To see the map, open the frontend/mapbox_uk.html file in the browser.
To get the newest data form OSM about the amount of solar panels in the UK postcode areas, type in the console:
The final data will be saved in frontend/postcodes_updated.json. The intermediate files (containing raw query results) will be saved in data_preprocessing/data.
The optional parameters for
calculate_stats_for_postcodes (useful when updating only FIT data and by debugging):
--osm_from_pickle– instead of querying solar panels coordinates from OSM, use already saved data from the recent search
--osm_postcodes_from_json– instead of querying postcode for each solar panel from OSM, use already saved results from the recent search
To use th newest FIT data – download the latest files here and update them manually according to Methodology section.
The FIT data used on the map come from this website. Each of the three files was manually pivoted (count for each Installation Postcode), filtered (Technology=Photovoltaic) and saved in data_preprocessing/UK_Installed_pannels as csv, with two columns:
- first - postcode district names.
- second - count of panels with given postcode
There are ~850k photovoltaic records in total; 14k of them (2%) with postal code UNKNOWN. The FIT files can be manually updated, accordingly to the specification above (unfortunately python crashed to open original xlsx files containing images).
Solar Pannels in OSM
The information about amount of solar panels provided for each postcode is retrieved in two steps:
- Solar panels are queried from OSM via overpass api.
- The closest postcode is queried for each solar panel via postcodes.io api
Then the statistics about number of solar panels are created. Panels are saved in OSM map in two formats - nodes (single point) and ways (area). To simplify, both single node and single way was assumed to be one solar panel.
The original file with postcode coordinates was downloaded from here (postcode-XXNN.* files). The file was preprocessed:
- Postcode shapes were simplified with Mapshaper asd saved as shp
- Original file was lacking several postcodes, which were manually added.
- File was saved as geojson: data_preprocessing/data/postcodes.js.
- Add missing postcodes to geojson (they disappeared due to postcode shapes simplification): BN42, CF47, CH47, DA18, DT1, FY2, G34, GL1, XH1, OX28, PE35, PL31, TA15, TF5, TN1, TN10
- automate downloading and preprocessing FIT data
- approximate UNKNOWN postcodes (from FIT data)