introduction
TO
Cartodb
and Ebola
Steve Bennett
Sign up: cartodb.com
tinyurl.com/ecarto
Housekeeping
Work in teams - share what you learn
Slides: tinyurl.com/ecarto
Sign up: cartodb.com
Objectives
By the end of today, you will be able to:
-
Turn
data
with latitudes & longitudes...
- that you provide as a spreadsheet
- or get from somewhere else
- or make from addresses
- into
dots
...
- that you can click on for more info
- that are colour coded
- or icon-coded
- ...on a
map...
- that you choose from a lovely selection
- which you can share with the world.
Introduction
Data visualisation
(CartoDB)
Basemap
(Tilemill)
(Tilemill)
CartoDB - Example 1
Example 2
Example 3
VicRoads Projects
And more
Not enough? cartodb.com/gallery
Get an account
cartodb.com
All data is public
All maps are public
Wait here
Ebola historic outbreaks
Get the dataset
(in another tab)
http://gis.researchmaps.net/sample/ebola.csv
Drag & drop here
About ebola.csv
http://www.nature.com/articles/sdata201442
lat & long (for geocoding)name (string - good for labels)ob_death (numeric - good for choropleths)case_type (fixed vocab - good for categories)
UNIQ_ID: A unique identification number for each occurrence at which index, secondary or
imported cases of EVD have occurred at unique geographic locations (n=117).
imported cases of EVD have occurred at unique geographic locations (n=117).
NAME: Text description of the point or polygon that defines the location of the occurrence.
COUNTRY: The country where the majority of cases occurred in each outbreak.
VIRUS: The Ebola virus species of each outbreak.
CASE_TYPE: The type of transmission represented by the Ebola occurrence. Can be either ‘index’, ‘secondary’ or ‘import’.
DATA_TYPE: Whether the occurrence represents a point or larger polygon location.
LOC_NTS: Additional notes describing the site location of the occurrence.
SPR_ORDER: The order of spread between occurrences over the course of the outbreak, as determined by the date of onset of the first case in a given occurrence. Index cases are represented with the value ‘1’. Two or more occurrences share the same spread order if it is unknown which of the two areas Ebola virus transmission spread to first.
SOURCE_1: The unique identification number of the occurrence where the first EVD patient came from.
SOURCE_2: The unique identification number of the occurrence where the first EVD patient came from. An occurrence may have more than one source if infected patients came from more than one source but it is unknown which triggered secondary transmission.
STR_DAY: Day of first reported case in the occurrence.
STR_MNTH: Month of first reported case in the occurrence.
STR_YEAR: Year of first reported case in the occurrence.
END_DAY: Day of last reported case in the occurrence.
END_MNTH: Month of last reported case in the occurrence.
END_YEAR: Year of last reported case in the occurrence.
REP_CASE: The total number of cases (suspected or confirmed) reported over the course of the outbreak, but only within the occurrence.
REP_DEATH: The total number of deaths (suspected or confirmed) reported over the course of the outbreak, but only within the occurrence.
OB_ID: A unique identification number for each outbreak (n=22).
OB_STR_DAY: Day of first reported case of the outbreak.
OB_STR_MNTH: Month of first reported case of the outbreak.
OB_STR_YEAR: Year of first reported case of the outbreak.
OB_END_DAY: Day of last reported case of the outbreak.
OB_END_MNTH: Month of last reported case of the outbreak.
OB_END_YEAR: Year of last reported case of the outbreak.
OB_CASE: The total number of cases (suspected or confirmed) reported over the course of the outbreak in all areas.
OB_DEATH: The total number of deaths (suspected or confirmed) reported over the course of the outbreak in all areas.
Tables: How do I...?(EXERCISE)
-
Change ob_end_mnth column type to "string" (and back)
-
Edit a cell
- Add a row
- Delete a row
-
Sort by a column
- Add a column
When finished, help someone else.
basemap (EXERCISE)
Pick a basemap. Any basemap.
What the buttons do
New layer
Select this layer
Custom SQL (advanced queries)
Wizards (visualisation type)
Info windows (when you click)
Custom CSS (advanced styling)
Legends (HTML required)
Filters
Add row
Info windows
...are easy
EXERCISE: make an appropriate info window
Visualisations for small data
"Simple" visualisation
Make this.
Category visualisation
Make this. (case_type → color)
Hint:
Markers
Make this
Labels
Can you make this?
Hint: Only some visualisation types support labels.
Fill & Stroke
Can you create these rings?
Stroke/Fill/LABEL
Challenge: make the ugliest visualisation
Choropleth (number as colour)
Number of cases as colour
Bubbles
Value as bubble size
Ob_case as size
Add another layer
With each visualisation, you can:
Share
Re-order layers
Combine styles
Present the same data differently
One visualisation has 1+ datasets.
One dataset has 1 map view, 0+ visualisations
More sample data! (exercise)
1. Leave your map, then:
Add your new layer
Go back to your map:
Add it:
Working with layers
Exercise:
1. Turn each layer on/off
2. Change the order of layers
3. Change the style of the new layer
Two layers at once
Challenge. You know the drill. :)
Visualisation
1 visualisation = 1+ layers
1 layer: 1 map
1, 2 = switch layers
visualisations for bigger data
Density
Category or Choropleth?
"Index", "Secondary", "Imported" → Category
1.2, 5.3, 2.4 → Choropleth
Cluster, Intensity or Density?
Experiment!
Buckets
1,2,3,4,5,6,7,8,9,10
3 buckets
1,2,3 4,5,6,7 8,9,10
(sort of)
Custom styling
When the wizard doesn't cut it
https://www.mapbox.com/carto/api/2.3.0/
Combine vis types
Geocoding
Creating lat/longs
Where before there were none
Make a new table
Add some addresses or place names
Georeferencing
Works better with context: Victoria, Australia
addresses cost $$$
Instead, provide your own lat/lon:
Or: Match admin regions (polygons) *
Match admin regions
a free way with GOogle sheets
1. Follow all instructions here:
https://github.com/mapbox/geo-googledocs
2. Geocode stuff in Google Sheets
3. Import
Adding data
Add feature. Click. Done. Click. Edit data. Save and close.
Or...
Add row
Then lat/long
More data!
CartoDB supports:
AURIN, data.gov.au, CartoDB "common data", Google...
Advanced
Basic SQL
Filter, group, aggregate, calculate
SELECT * FROM ebola
WHERE name ILIKE '%Hospital%'
Not basic SQL
Any basemap
Sharing
Export image
More help?
CartoDB documentation
gis.stackexchange.com
steve.bennett@unimelb.edu.au
Drop-in sessions
Feedback please!
Intro to CartoDB (Ebola)
By stevage
Intro to CartoDB (Ebola)
- 1,196