Maps — Lightening talk at Hacks/Hackers MCR
09 December 2014
I did a quick introduction to digital maps at Hacks/Hackers Manchester in November. Here’s the instructions and links for reference.
Geocoding
A quick and simple process for getting the latitude and longitude for a column of addresses.
- New Google spreadsheet – Columns: Location, lat, lon
- Tools->Script Editor
- “Create new project”
- “Blank Project”
- Paste in this script – https://gist.github.com/robertocarroll/a819e8b625d73068bc15
- Publish->Deploy as Web App
- Spreadsheet -> select rows -> Macros-> Geocode Selected Cells Worldwide
- Each address should now have co-ordinates
Export
Geojson is a good format for the data. It is flexible and allows you to add your own data to the structure. It’s quite easy to read, but it can be inefficient with large data sets and polygons (consider Topojson if project can work with modern browsers <IE8)
To export:
- Tools -> Script Editor
- “Create new project”
- “Blank Project”
- Paste in this script -https://raw.githubusercontent.com/mapbox/geo-googledocs/master/MapBox.js
- Publish->Deploy as Web App
- Spreadsheet -> select rows -> Geo -> Export
Display
- Try using http://geojson.io
- Cut and paste the geojson data exported above into the text window.
- Your points will appear on the map
- Table view is good to see and scan your data
- Use Github pages – free hosting and version control. Update the data using http://geojson.io
- Lots of ways to customise how the map looks and behaves, eg Tilemill (no programming skill required) or Mapbox JavaScript API (you need to know some JavaScript)
Tutorials
- Mapschool, by Tom MacWright
- Learning Lunch on maps, by Noah Veltman
- Let’s Make a Map, by Mike Bostock
- Tom MacWright’s Mapmaker’s Cheatsheet
- When maps shouldn’t be maps, by Matthew Ericson
Data sources
- ONS
- Ordinance Survey or here
- US Census Bureau, for detailed data about the US (mostly shapefiles)
- Natural Earth, for downloads of basic natural/political boundaries for the entire world
- OpenStreetMap, for detailed, mappable data about almost every place in the world
Interesting examples
Digital maps tend to follow certain formats, but these examples show different and interesting approaches: