Week 6 - Geospatial

This week we’re going to play with spatial functions. Frosty Lobbying is thinking of supporting some candidates in the next UK General Election. What they need is to understand the geographic spread of candidates by nation/region of the UK.

Your job is to build both the nations/regions and parliamentary seats into polygons, and then work out how many Westminster seats intersect with region polygons. 

Be wary that some seats may sit within two different regions, some may not sit within any (Northern Ireland is not included in the data provided) and some may just be awkward.

Note: Within the data, the 'part' column is an integer given to each landmass that makes up that region/nation/constituency - for example, the Isle of Mull could be 'part 34' of Scotland, and 'part 12' of the Argyll and Bute constituency.

You can find the nations are regions data here and the Westminster constituency data here.

Source: ONS, Open Geography Portal

End Result:

NATION_OR_REGIONINTERSECTING_CONSTITUENCIES
South East116
North West95
London91
East of England82
West Midlands80
East Midlands78
Yorkshire and The Humber76
South West70
Scotland63
Wales52
North East33

Remember if you want to participate:

  1. Sign up as a member of Frosty Friday. You can do this by clicking on the sidebar, and then going to ‘REGISTER‘ (note joining our mailing list does not give you a Frosty Friday account)
  2. Post your code to GitHub and make it publicly available (Check out our guide if you don't know how to here)
  3. Post the URL in the comments of the challenge.

If you have any technical questions you’d like to pose to the community, you can ask here on our dedicated thread.

Previous
Previous

Week 7 - Security & Governance

Next
Next

Week 5 - Stored Procedures & UDFs