Skip to content

Instantly share code, notes, and snippets.

@jsanz
Last active May 19, 2018 21:12
Show Gist options
  • Save jsanz/63aae1b8f3ad04498aec to your computer and use it in GitHub Desktop.
Save jsanz/63aae1b8f3ad04498aec to your computer and use it in GitHub Desktop.
CartoDB training script

CartoDB users training

First session: Introduction to CartoDB

Thi session is oriented for unexperienced users on CartoDB. It will also present a short introduction to the platform as well as their main components and principal use cases.

Overview:

  • Upload and data management
  • Editing and querying data on the platform
  • Cartographic symbology and visualizations
  • Infowindowns creatino
  • Using dynamic filters
  • Data synchronization
  • Temporal mapping

Contents

  • Introduction to CartoDB slides (30 minutes)
  • Some use cases. slideshow
  • CartoDB for beginners. Course
    • First steps (45m/1h)
      • Create your account
      • Import the dataset called Populated places from the Data Library
      • Your first point map
    • Coropleth map (45m)
      • Importing data from a web address http://acdmy.org/d/counties.zip
      • How sync tables work
      • Difference between a dataset and a map on the CartoDB editor
      • Adding interactivity to your map
        • Infowindws
        • Tooltips
        • Customizing infowindows and tooltips
      • Population coropleth map
        • Absoulte vs. normalized data
        • Quantification tyes (jenks, equal interval, ...)
    • Thematic maps with point data (1h)
      • Import a new dataset from http://acdmy.org/d/tornadoes.zip
      • Changing column types
      • Simple point sybmology
      • How to duplicate a map
      • Bubble map
      • Intensity map
      • Density map
      • Adding labels
      • Filtering data
    • Dynamic maps (45m)
      • Basic Torque: dynimic data column, parameters
      • Accumulated map
      • Category Torque
    • Multi layer map (15m)

Other resources:

SQL used to create categories for the Torque exercise based on tornados damage:

SELECT 
*, 
CASE 
WHEN damage > 7.4 THEN 1
WHEN damage > 0.5 THEN 2
ELSE 3
END damage_cat
FROM tornados order by damage_cat

Second session: Cartography design and Spatial SQL

Training to users with some previous experinece on CartoDB, creating maps from the editor.

Overview

  • Advanced data visualization
  • CartoCSS
  • PostGIS introduction
  • Basic PostGIS functions
  • Data analysis using PostGIS SQL
  • Table editing on CartoDB

Contents

  • Map design
  • SQL and PostGIS in CartoDB
    • Documentation
    • The SQL Editor
    • Types in PostGIS: geometry and geography
    • About the_geom and the_geom_webmercator columns
    • Measuring distances and areas: ST_Distance, ST_Area and ST_Length
    • Spatial analysis exercise, lesson
      • Getting the closest points to a geometry using ST_Buffer and ST_Intersects or ST_DWithin
      • Getting the line that connects a point with a line with ST_Makeline and ST_ClosestPoint
    • Joining tables, tutorial
      • Counting points inside polygons, tutorial
      • Mapping the number of tornados per USA county.
    • Other interesting functions to review:
      • ST_Centroid and ST_PointOnSurface: getting the interior point of a geometry
      • ST_AsText: WKT geometry representation
      • ST_Transform: changing from one coordinates system to another
      • ST_SetSRID: setting the geometry coordinate system
      • ST_Envelope: getting the bounding box of a geometry
      • ST_MakeEnvelope: creating a bounding box from maximum and minimum coordinates
    • More PostGIS/CartoDB resources:
      • More queries examples and documentation about CartoDB specific SQL functions: CDB_LatLng, how to create grids, etc.
      • 10 spatial queries you need to know, blog
      • Drawing maximum circles that cross the Date line, blog
      • Simulating Dubai flights, generating torque maps from maximum circles. Map and SQL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment