Importing a spreadsheet

If you've found yourself on this page, we're assuming you've

Tip: Want to import a spreadsheet directly to Mapbox.com? See the documentation for import CSV & other types of files directly into the editor.

One of the many geo formats that TileMill supports is a spreadsheet, specifically a comma-separated values (CSV) file. We want to start by working with a basic spreadsheet to show how easy it is to make a simple point map.

Your CSV spreadsheet

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. We have hard coded TileMill to look at the column headers for any mention of “lat” or “latitude”, so something like “geo_longitude” will even work.

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.

In this crash course, we’ll use earthquake data from the USGS to make a map showing points for earthquakes that have occurred.

  1. Start TileMill and click on the “New project” button on the main screen. Add project
  2. Enter a “Filename” for your project and click “Add”. You can leave the other fields alone for now. Add project
  3. Click on the new project to open it. The project contains a default layer called #countries styled with some example CartoCSS code.
  4. To add a CSV layer, first click the “Layers” button located on the bottom left to bring up the Layers panel. Add layer
  5. Now click “Add layer”. Add layer
  6. Enter earthquakes in the “ID” field. You’ll use this ID to to reference this layer in CartoCSS selectors.
  7. Enter the URL https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv into the “Datasource” field.
  8. Click the “Save & Style” button. This will add the layer to your project and insert a default CartoCSS rule for the layer. Add layer
  9. Preview the result in the map preview pane. Styled map
Misson complete! Next up