Skip to content

Instantly share code, notes, and snippets.

@Robsteranium
Robsteranium / ons-shp-2-geojson.md
Last active March 9, 2021 19:48
Convert ONS Shapefiles to GeoJSON

This gist describes how to create GeoJSON polygons from UK statistical boundaries for use in choropleths.

  1. Download the boundaries you're interested in from the ONS's Open Geography Portal:

    wget https://geoportal.statistics.gov.uk/Docs/Boundaries/Clinical_commissioning_groups_\(Eng\)_Apr_2013_Boundaries_\(Generalised_Clipped\).zip -O ccg-2013.zip
    unzip ccg-2013.zip -d shapes
    
  2. Re-project this from UK Grid Reference Eastings and Northings into Latitude and Longitude coordinates (i.e. EPSG:4326 aka WGS 84). You can use GDAL to do this:

@dopiaza
dopiaza / slackpost
Created September 5, 2013 12:33
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1