TileMill is a free-to-download application for Windows and the Mac that will let you build beautiful, data driven maps. If the bland sameness of Google maps is giving you ennui, TileMill might be a good alternative for you. There are many beautiful stylesheets to make TileMill maps visually distinct, and you can control the colors, line widths, and much more about your map using Carto, a CSS-derived language.
So begins the Introduction to Lisa Williams’ Insanely Illustrated Guide To Your First Data-Driven TileMill Map. But for my learning purposes, I’m going to start with MapBox’s crash course in TillMill first, and then work through Lisa’s guide in a future post.
What I have learned :
- manipulating geospatial data needs to be done outside of TileMill
- “The main output of TileMill is tiled maps – millions of 256 px by 256 px images that can be loaded quickly in interactive maps – exported in MBTiles format. Tiled maps are the basic technology behind the best panning and zooming maps on the web. You can also export PNG and PDF files from TileMill for static output or use in presentations – using the same map styles that power your highly interactive maps.“
- To import data into TileMill as a CSV file you need column headings on the first row. The CSV must also contain columns with latitude and longitude geographic coordinates…If your CSV contains place names or addresses instead of lat/lon coordinates, you will have to geocode the data before it will work in TileMill. We have a plugin for Google Docs that makes geocoding easy.
Wait, what? There’s “an add-on script for Google Docs Spreadsheets that lets you geocode arbitrary addresses and export spreadsheets as GeoJSON“? That’s good to know!
For this example, I thought I’d try using the data set of Heritage Sites from the City of Windsor’s Open Data Catalogue. When I add it to TileMill, it looks like this:
Clearly, it needs some style.
TileMill uses a language called CartoCSS to determine the look of a map. Colors, sizes, and shapes can all be manipulated by applying their relative CartoCS parameters in the stylesheet panel to the right of the map. Read the CartoCSS manual for a more detailed introduction to the language.
I tried applying a little conditional CartoCS but didn’t get far. I checked the FAQ for more info and didn’t find what I was looking for, but I did find an answer to another question I was also wondering about:
If your data is completely non-georeferenced (has no latitude, longitude position), and it’s raster, you might want to check out this guide (Images as Maps)
Ok, well the crash course is done and my map still doesn’t look too great. Time to get to Lisa Williams guide to see if she can help me… and she can.
Following her advice, I tried to add shapefiles from Street Centreline datasets from the data catalogue and see how it looks, but it spat out “Unable to determine SRS for layer “street_centreline” in response. Then by going back to the TileMill short course, I realized that I should have uploaded a .zip file of the needed shapes – not just the .shp file alone.
Holy cats! It worked!