- got UK local authority data from https://www.sharegeo.ac.uk/handle/10672/305
- converted .shx file to .js using ogr2ogr -f “GEOJSON” newfilename.js sourcefilename.shx
- open resulting 88MB file in Word – around 10,000 pages.
- Find first mention of Scotland – it’s about 7000 pages in. It’s to do with Angus.
- Find second mention of Scotland. This is in the code marking the start of the data for Clackmannanshire.
- Select all the data for Angus, then cut it out and paste it to a new document. Save that as Angus.txt.
- Repeat steps 4 to 6 to get data files for all 32 Scottish LAs.
- Such a shame they are in National Grid format, not lat/long.
- proj4leaflet claims to handle other projections. Trying it but the huge size of the clackmannashire data file seems to be killing Eclipse. So have abandoned that, going back to what we have so far and trying to convert NG co-ords to latlong.
- http://gridreferencefinder.com/batchConvert/batchConvert.php batch converts but there’s a lot of Word/RegEx jiggery pokery to prepare the stuff for batch-conversion, then convert the results to array format.
- It almost works for Aberdeen, but a few data-points seem to be missing.
- (Ignore the blue line and shading in the first screenshot – it’s part of a very rough outline of the UK, from when I was trying to get to grips with geoJSON use in Leaflet.
- The conversion step is choking my mac, so time to ask the internet if anyone has LatLong shapefiles for the Scottish LAs.
- Here endeth today’s lesson.