The source code for the website middleclassmap.co.uk.
After reading about middle class city dwellers dreams of moving away from the pandemic ridden streets in search of the good life in The Guardian and Financial Times during 2020, I thought it would be interesting to map out their potential destinations.
This website combines and presents the location data for a number of popular middle class haunts, from trendy independent boutiques to salt of the earth farm shops. Data is presented as a heatmap (with each point adjusted for population density) at low zoom levels and as a pin board at high zoom levels.
All data displayed on this website is in the public domain and was extracted from the following sources:
- Côte Brasserie
- Fabulous Farm Shops
- Gail's Bakery
- Independent Cinema Office
- John Lewis
- JoJo Maman Bébé
- Michelin Guide
- Pets Corner
- Royal Horticultural Society
- Space NK
- Sweaty Betty
- The National Trust
- The White Company
- Trouva
Different techniques were used to scrape data from each source, primarily using a combination of Node, Cheerio, and Puppeteer. Data scraped from websites without coordinates was geocoded using open postcode data from Postcodes.io. The scripts used to fetch and format the raw data are stored in a private repo because retrieving some of it required a little more sleuthing than I feel comfortable sharing.
No websites were harmed in the making of this one.
UK population data was provided by the UK Centre for Ecology & Hydrology and this dataset is freely available here. The dataset was integrated using the Geodesy library published by Chris Veness.
The map itself is powered by Mapbox.