Hacks/HackersMcr – Skill sharing
Hacks/Hackers is about discussions, networking and skill sharing so here’s my fave takeaway from December’s Hacks/HackersMCR meet-up. Thanks to my co-organiser, Rob, for passing on his digital mapping knowledge….
So GEOCoding is the process of getting richer data about a location. Typically, you have street addresses or postcodes and you want to convert them into coordinates with longitude and latitude. This helps you to do more fun things with maps (which I’ll get onto in a future blog post).
One of my students needed to do this for a project he was working on but, unfortunately, this HHMcr skill share came a bit late for that.
You can do this super quick in a Google spreadsheet!
GitHub? Are you serious?
So if you missed the December HHMcr meet-up, you can find out how to do this in this very useful blog post from Mapbox. Or you can read on and I’ll attempt to explain in a quick and easy way that even non-coding journalists like me can understand. It involves going to GitHub but DON’T PANIC! I went to GitHub and came out again unharmed. If you haven’t heard of it, GitHub is a huge, social platform for collaborating on projects. Yes, it started out as a place for very clever programmers but it’s evolved into so much more and we should all resolve to spend some time there.
Go to GitHub and copy this code. I don’t pretend to understand the code but I do know how to Copy and Paste so I’m good to go.
Next, open your Google spreadsheet and click on the tab Tools>Script Editor. Paste the code you just copied into this space (getting rid of the default wording that’s already there). Call it Geo, save and close and refresh your spreadsheet. As if by magic, you’ll now see a new tab has appeared called Geo.
Now the fun starts. Select the addresses/postcodes you want to geocode – it could be a whole column or just a few cells. Click that Geo tab you just cleverly created. Then click “Geocode addresses.” It’ll ask you to authorise this. If you’re happy using MapQuest to find your data (at this stage, you are), just click Geocode. You might need to be a little patient, but this should create three new columns in your spreadsheet with your longitude and latitude coordinates. The third column (geo_accuracy) helps you check, erm, the accuracy of the coordinates. It’ll usually say something like “residential.” If it says something unexpected, it might be a sign it’s not found the correct coordinates and you may need to put more/slightly different information into the address. So, as always, check and check again.
Allow yourself a well-deserved fist pump.
That’ll do for now. I’ll blog more about some stuff we can do with this (JSON, yeah!)