Choropleth maps

and common methods

@JacopoOttaviani

www.aljazeera.com/ewasterepublic

elpais.com/especiales/2015/basura-electronica/

What we have in play

  1. A topic
  2. Some research questions
  3. A dataset loaded on Carto, with:
    • a location column
    • a geo-referenced geometry column
  4. A simple Carto map with points and infowindows

We will learn to

  1. Transform the locations into geometric areas (a.k.a. polygons, such as regions or municipalities)
  2. Merge tables
  3. Make choropleth maps (with coloured areas)

Geometry is a data type

  • The location column consists of a string (e.g., country name) or numbers (latitude/longitude)
  • Carto needs to transform the location column into «geometry» so that it can place points, lines or polygons on the map
  • Geometry is a data type that represents points, lines and polygons (e.g., areas)
  • The geometry column in Carto is very important.
  • It is named by default the_geom and has an orange GEO tag

'Maps' formats

  • 'Maps' come in different formats: GeoJSON, KMZ (Google Earth), and Shapefiles
  • When we say 'maps' here, we mean boundaries of administrative areas
  • Such files are necessary to explain Carto what areas you want to colour in the map
  • More info on the formats: http://gadm.org/country

States of India

GeoJSON, KMZ, Shapefiles...

  • These files are available online in geographic portals for most “administrations” in the world
  • e.g., Spanish municipalities, CCAAs, Italian regions, Irish counties, United States of America, Asian countries, World countries, etc.
  • Imagine them like tables with text representations of administrative areas
  • To find them:

courtesy of Jens Finnäs

A gift for you

http://j.mp/regalo-para-mi

Now we have

  • A dataset loaded on Carto (the one about topic/research questions)
  • Downloaded a shapefile with the geometry of the administrative areas you want to colour – and loaded it on Carto
  • It's time to put things together!

Merging tables: the concept

Let's merge

You want to merge two tables: 

  1. The table with your data
  2. The table with the map (e.g., the shapefile of CCAAs)
  3. Once merged, from your new table you'll be able to create your first choropleth map

A choropleth map (from Greek χώρο ("area/region") + πλήθος ("multitude")) is a thematic map in which areas are shaded or patterned in proportion to the measurement of the statistical variable being displayed on the map, such as population density or per-capita income. [source: Wikipedia]

Questions?

Exercise #2. Choropleth map

Merge two tables and visualise the resulting table on a choropleth map: 

  1. Download this dataset about early school leaving in Spain: http://bit.ly/abandon-escolar
  2. Upload it and check data types
  3. Upload the shapefile of the administrative areas 
  4. Merge the tables: 
    • Select the column in common to merge the tables
    • Include the right the_geom column
    • ​Exclude the columns you don't need
  5. Visualise the new (merged) table on a map (use wizards)
  6. Play with the choropleth map (colours, info-windows, title, headline, legend, etc.)

#3 - Choropleth maps

By jottaviani

#3 - Choropleth maps

  • 751