Slide 1

Slide 1 text

Maps, Lies & Storytelling Class 4

Slide 2

Slide 2 text

Welcome!

Slide 3

Slide 3 text

homework

Slide 4

Slide 4 text

Maps, Lies & Storytelling Section 6 - Learning SQL

Slide 5

Slide 5 text

SQL in CartoDB Can be viewed as the entry point for complex geospatial analysis, tool building, and data manipulation

Slide 6

Slide 6 text

Common SQL Statements SELECT UPDATE INSERT DELETE * there are lots of that we wont get into ** these can (and often are) mixed

Slide 7

Slide 7 text

Breaking down a SELECT statement

Slide 8

Slide 8 text

SELECT * FROM us_states The FROM statement tells us which table we are selecting data from

Slide 9

Slide 9 text

SELECT * FROM us_states The “*” here means, select ALL fields (or columns)

Slide 10

Slide 10 text

SELECT cartodb_id, name FROM us_states Here, I’ve opted to select only two columns specifically

Slide 11

Slide 11 text

SELECT cartodb_id, name FROM us_states The result of this query will have just the two columns I ask for, but for every row in my dataset cartodb_id name 1 new york 2 alabama etc

Slide 12

Slide 12 text

Here, I can limit it to just one column. SELECT cartodb_id FROM us_states cartodb_id 1 2 etc Notice that the result contains the column name

Slide 13

Slide 13 text

You can create an ‘alias’ for the result. Basically, change the name it uses for the result. SELECT cartodb_id AS my_id FROM us_states my_id 1 2 etc Notice that the results are the same, just a different name

Slide 14

Slide 14 text

You can modify values on the fly using SQL, for example, simple arithmetic. SELECT cartodb_id + 4 AS id FROM us_states id 5 6 etc The result isn’t stored anywhere permanently, it is derived on the fly

Slide 15

Slide 15 text

You can use a type of function, called an ‘Aggregate’ that measures across all rows at once. SELECT min(cartodb_id) AS id FROM us_states id 1 Now, only 1 row is returned

Slide 16

Slide 16 text

You can use a type of function, called an ‘Aggregate’ that measures across all rows at once. SELECT sum(cartodb_id) FROM us_states sum 1328 Now, only 1 row is returned

Slide 17

Slide 17 text

You can make up columns out of thin air. ! Notice that andrew is single quoted. That is the standard for strings SELECT cartodb_id, ‘andrew’ FROM us_states notice that ‘andrew’ remains constant for all rows cartodb_id unknown 1 andrew 2 andrew etc

Slide 18

Slide 18 text

Filtering using WHERE

Slide 19

Slide 19 text

Using WHERE statements will allow you to narrow in on exactly the rows you want SELECT cartodb_id FROM us_states WHERE cartodb_id = 1 cartodb_id 1 Here, only the single matching row is returned

Slide 20

Slide 20 text

Using WHERE statements work on all types of data SELECT name FROM us_states WHERE name = ‘New York’ name New York See!

Slide 21

Slide 21 text

When using string columns, they case sensitive SELECT name FROM us_states WHERE name = ‘new york’ name oh no! no results

Slide 22

Slide 22 text

Using WHERE statements will allow you to narrow in on exactly the rows you want SELECT cartodb_id FROM us_states WHERE cartodb_id > 24 cartodb_id 25 26 etc

Slide 23

Slide 23 text

You aren’t limited to using values as they exist, you can manipulate them on the fly SELECT cartodb_id FROM us_states WHERE cartodb_id*4=20 cartodb_id 5

Slide 24

Slide 24 text

With strings, you can do things like case insensitive partial matching. Here, ‘%’ is a wildcard, and ILIKE says use the wild card and ignore case SELECT name FROM us_states WHERE name ILIKE ‘new%’ name New Hampshire New Jersey etc Nice!

Slide 25

Slide 25 text

You can check if a value is in a set of options SELECT cartodb_id FROM us_states WHERE cartodb_id IN (1,4,99) name 1 4 Not 99 states

Slide 26

Slide 26 text

Always watch your quotes! ‘text’

Slide 27

Slide 27 text

Constrain results with ORDER BY & LIMIT

Slide 28

Slide 28 text

The LIMIT restricts the number or rows you ask for SELECT cartodb_id FROM us_states WHERE cartodb_id > 24 LIMIT 1 cartodb_id 25 see!

Slide 29

Slide 29 text

The LIMIT restricts the number or rows you ask for SELECT cartodb_id FROM us_states WHERE cartodb_id > 24 LIMIT 2 cartodb_id 25 26 see!

Slide 30

Slide 30 text

The ORDER BY allows you to change the order of rows in your result SELECT cartodb_id FROM us_states WHERE cartodb_id > 24 ORDER BY cartodb_id cartodb_id 25 26 etc The default is determined by the order on disk. no noticeable change here

Slide 31

Slide 31 text

ASC means, ascending. SELECT cartodb_id FROM us_states WHERE cartodb_id > 24 ORDER BY cartodb_id ASC cartodb_id 25 26 etc Here, ascending is the same as what we saw before

Slide 32

Slide 32 text

DESC means, descending SELECT cartodb_id FROM us_states WHERE cartodb_id > 24 ORDER BY cartodb_id DESC cartodb_id 52 51 etc See!

Slide 33

Slide 33 text

It works just as well on the alphabet SELECT name FROM us_states ORDER BY name DESC name Wyoming Wisconsin etc See!

Slide 34

Slide 34 text

USING GROUP BY

Slide 35

Slide 35 text

Let’s do something crazy here, substring() SELECT substring(name,1,3) FROM us_states substring Ala Ala Ari etc So we are asking for the first 3 characters of the state name

Slide 36

Slide 36 text

We can add a GROUP BY, which will join all rows with the same results SELECT substring(name,1,2) FROM us_states GROUP BY substring(name,1,2) substring Ala Ari Ark etc The second ‘Ala’ disappeared from our results

Slide 37

Slide 37 text

We can now use an aggregate that will work within each group result, not across the who table SELECT substring(name,1,2), count(*) FROM us_states GROUP BY substring(name,1,2) substring count Ala 2 Ari 1 Ark 1 etc Now we can see where that second ‘Ala’ went to!

Slide 38

Slide 38 text

Let’s find out what the most common first three letters of state names is by including an ORDER BY SELECT substring(name,1,2), count(*) FROM us_states GROUP BY substring(name,1,2) ORDER BY count(*) DESC substring count New 4 Nor 2 Ala 2 etc So ‘New’ has 4, which we all experience from trying to quickly fill online address forms…

Slide 39

Slide 39 text

SQL Joins to query across tables

Slide 40

Slide 40 text

Someone else has done a really nice job of describing and illustrating this, so I’m going to shamelessly reuse

Slide 41

Slide 41 text

http://bit.ly/1vjVAUA

Slide 42

Slide 42 text

http://bit.ly/1vjVAUA

Slide 43

Slide 43 text

http://bit.ly/1vjVAUA

Slide 44

Slide 44 text

http://bit.ly/1vjVAUA

Slide 45

Slide 45 text

http://bit.ly/1vjVAUA

Slide 46

Slide 46 text

http://bit.ly/1vjVAUA

Slide 47

Slide 47 text

http://bit.ly/1vjVAUA

Slide 48

Slide 48 text

http://bit.ly/1vjVAUA

Slide 49

Slide 49 text

I also love nested queries

Slide 50

Slide 50 text

Here, I use a nested queries and compare against the results for a state name SELECT name, state FROM us_cities WHERE state IN (SELECT name FROM us_states WHERE name ILIKE ‘new y%’) name state New York New York Albany New York Buffalo New York etc

Slide 51

Slide 51 text

You can also nest right in the column results! SELECT name, (SELECT population FROM us_census WHERE name = u.name) pop FROM us_cities u ORDER BY pop DESC name pop California 38000000 Texas 26000000 New York 20000000 etc

Slide 52

Slide 52 text

The CTE or the “with” statement

Slide 53

Slide 53 text

You can use a WITH statement to treat a SQL result as a new table WITH fakestuff AS (SELECT name, state FROM us_cities WHERE name = ‘New York’) SELECT * FROM fakestuff name state New York New York Here, I create a magical new table- like object I call “fakestuff” When I select ‘*’ from the fakestuff table- ish thing, the result is only one row

Slide 54

Slide 54 text

I use them to help organize my thinking in SQL WITH fakestuff AS (SELECT ST_Centroid(the_geom) AS the_geom, name, pop FROM us_states) SELECT * FROM fakestuff WHERE pop > 5000000 name state New York New York

Slide 55

Slide 55 text

DELETES & UPDATES

Slide 56

Slide 56 text

UPDATES work with all the same properties of SELECT but with a few differences. UPDATE us_states SET name = ‘New Amsterdam’ WHERE name = ‘New York’ For example, you will only get a confirmation result, not actual rows. (typically)

Slide 57

Slide 57 text

Same goes for DELETE statements DELETE FROM us_states WHERE name = ‘New York’

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

An very basic introduction to spatial SQL

Slide 60

Slide 60 text

SELECT the_geom FROM us_states In CartoDB, your geometries are always standardized and stored in a column called the_geom the_geom MULTIPOLYGON… MULTIPOLYGON… etc

Slide 61

Slide 61 text

SELECT the_geom FROM us_states ORDER BY the_geom ASC You can manipulate, filter, order, measure and lots of other things to geometries the_geom MULTIPOLYGON… MULTIPOLYGON… etc

Slide 62

Slide 62 text

SELECT the_geom FROM us_states WHERE ST_Intersects(the_geom, my_geometry) CartoDB uses PostGIS to enable most geospatial functions. These are the functions that start with ‘ST_…’ the_geom MULTIPOLYGON…

Slide 63

Slide 63 text

SELECT the_geom FROM us_states WHERE ST_Intersects(the_geom, CDB_(42, -80)) We also have a couple of helper functions only in CartoDB, these start with CDB_. For example, CDB_LatLng(num, num) creates a geometry from two coordinates the_geom MULTIPOLYGON…

Slide 64

Slide 64 text

SELECT the_geom FROM us_states WHERE ST_Intersects(the_geom, CDB_(42, -80)) ST_Intersects returns TRUE if the two geometries intersect one another

Slide 65

Slide 65 text

SELECT the_geom FROM us_states WHERE ST_DWithin(the_geom, CDB_(42, -80), 1) ST_DWithin returns TRUE if the two geometries are within a minimum distance (supplied as the 3rd variable)

Slide 66

Slide 66 text

SELECT the_geom FROM us_states WHERE ST_DWithin(the_geom, CDB_(42, -80), 1) In CartoDB, we rely on projections. Using functions where we supply a unit measurement, that unit is always in the unit of the projection. Here, 1 degree lat/lng. Somewhat meaningless.

Slide 67

Slide 67 text

SELECT the_geom FROM us_states WHERE ST_DWithin(the_geom::geography, CDB_LatLng(42, -80)::geography, 10000) You can use a spherical globe and measure in meters by re-casting the geometries to geography types (on the fly)

Slide 68

Slide 68 text

SELECT the_geom FROM us_states ORDER BY the_geom <-> CDB_LatLng(44,-80) You can ORDER BY the distance to a specified geometry really nicely in CartoDB using <->

Slide 69

Slide 69 text

SELECT *, ST_Distance(the_geom, CDB_LatLng(42,-80)) AS d FROM us_states You can also use spatial measurements to derive a new or modified column result on the fly

Slide 70

Slide 70 text

SELECT *, ST_Distance(the_geom, CDB_LatLng(42,-80)) AS d FROM us_states ST_Distance will give me back the distance between two geometries. Here, the geometry in every row of my table would be measured from the point 42, -80

Slide 71

Slide 71 text

SELECT *, ST_Distance(the_geom::geography, CDB_LatLng(42,-80)::geography) AS d FROM us_states Remember, this returns a unit, so we might want to ensure we get meters

Slide 72

Slide 72 text

SELECT name, ST_MakeLine(the_geom, CDB_LatLng(42,-80)) AS the_geom FROM us_cities You can use ST_MakeLine to create lines between points on the fly. Here, I’ll turn every city point, into a line between that point and my point at 42, -80

Slide 73

Slide 73 text

UPDATE us_cities SET the_geom = ST_MakeLine(the_geom, CDB_LatLng(42,-80)) AS the_geom You can use all the stuff in UPDATES to store results as well. If I ran this, my cities would no longer be points, but would be lines! Careful, there is no UNDO!

Slide 74

Slide 74 text

SELECT name, ST_Centroid(the_geom) AS the_geom FROM us_states Likewise, we can turn polygons or lines into points. There are multiple ways to do this. ST_Centroid is one

Slide 75

Slide 75 text

SELECT name, ST_Envelope(the_geom) AS the_geom FROM us_cities GROUP BY state Or you could turn points into a polygon. ST_Envelope will create the minimum box around a group of points

Slide 76

Slide 76 text

the_geom versus the_geom_webmercator

Slide 77

Slide 77 text

the_geom the_geom_webmercator the_geom_webmercator When you create new data, it goes into, Behind the scenes, CartoDB also translates it to, When CartoDB draws a map, it comes from,

Slide 78

Slide 78 text

the_geom the_geom_webmercator Measure using Latitude, Longitude with,

Slide 79

Slide 79 text

the_geom the_geom_webmercator Select data to “Create new table” and include,

Slide 80

Slide 80 text

the_geom the_geom_webmercator Select or filter data you want on the map, include,

Slide 81

Slide 81 text

the_geom the_geom_webmercator CartoDB can’t render the map without

Slide 82

Slide 82 text

the_geom the_geom_webmercator Anytime you modify and store data on CartoDB will update so your maps are accurate,

Slide 83

Slide 83 text

the_geom the_geom_webmercator If you modify on the fly and want to map results, you need to create on the fly also!

Slide 84

Slide 84 text

SELECT cartodb_id, the_geom, the_geom_webmercator FROM us_states ORDER BY the_geom <-> CDB_LatLng(44,-80) You can do any filter you want, just make sure you include the_geom_webmercator in your column results to show it on the map

Slide 85

Slide 85 text

SELECT cartodb_id, ST_Buffer(the_geom, 1) FROM us_cities This wont display anything on your map, because it lacks the_geom_webmercator

Slide 86

Slide 86 text

SELECT cartodb_id, ST_Buffer(the_geom, 1), the_geom_webmercator FROM us_cities This would show the original points, but it would fail to include the transformed (buffered) point because the_geom hasn’t been altered on disk

Slide 87

Slide 87 text

SELECT cartodb_id, ST_Buffer(the_geom, 1) AS the_geom_webmercator FROM us_cities Just aliasing to the_geom_webmercator wont work, remember the_geom is a different projection than the_geom_webmercator

Slide 88

Slide 88 text

SELECT cartodb_id, ST_Transform(ST_Buffer(the_geom, 1), 3857) AS the_geom_webmercator FROM us_cities ST_Transform to the rescue!

Slide 89

Slide 89 text

SELECT cartodb_id, ST_Transform(ST_Buffer(the_geom, 1), 3857) AS the_geom_webmercator FROM us_cities ST_Transform turns projects any geometry from one projection to another. We want to go from WGS84 (the_geom) to Web Mercator (the_geom_webmercator)

Slide 90

Slide 90 text

SELECT cartodb_id, ST_Transform(ST_Buffer(the_geom, 1), 3857) AS the_geom_webmercator FROM us_cities In CartoDB, webmercator has an ID, or a SRID to be exact, that we can use to tell ST_Transform that we want webmercator from the_geom. The SRID is 3857 3857 = Web Mercator

Slide 91

Slide 91 text

SELECT cartodb_id, ST_Transform(ST_Buffer(the_geom, 1), 3857) AS the_geom_webmercator FROM us_cities Now our result will be on the map dynamically!

Slide 92

Slide 92 text

You can update the SQL of any layer in your visualizations with the setSQL function ! layer.setSQL(“SELECT * FROM us_states WHERE name = ‘New Hampshire’”); In CartoDB.js http://bit.ly/1t8vK1i

Slide 93

Slide 93 text

http://bit.ly/short-sql Don’t forget, more SQL examples

Slide 94

Slide 94 text

Let’s look at some of this live!

Slide 95

Slide 95 text

Maps, Lies & Storytelling Part 7 - More on CartoCSS

Slide 96

Slide 96 text

Once you’ve got the things you want to render, you will define a set of rules in CartoCSS to define how you render it

Slide 97

Slide 97 text

CartoCSS in CartoDB Can be viewed as the entry point for cartography and design

Slide 98

Slide 98 text

a few of the basics

Slide 99

Slide 99 text

#table{ polygon-fill: #FF6600; polygon-opacity: 0.7; line-color: #FFF; line-width: 1; line-opacity: 1; }

Slide 100

Slide 100 text

#table{ polygon-fill: red; polygon-opacity: 0.7; line-color: #FFF; line-width: 1; line-opacity: 1; }

Slide 101

Slide 101 text

#table{ polygon-fill: rgb(0,0,256); polygon-opacity: 0.7; line-color: #FFF; line-width: 1; line-opacity: 1; }

Slide 102

Slide 102 text

#table{ polygon-fill: #AEFF39; polygon-opacity: 0.2; line-color: #FFF; line-width: 1; line-opacity: 1; }

Slide 103

Slide 103 text

#table{ polygon-fill: #E94C6F; polygon-opacity: 0.9; line-color: #542733; line-width: 4; line-opacity: 1; }

Slide 104

Slide 104 text

#table{ marker-fill-opacity: 0.9; marker-line-color: #FFF; marker-line-width: 1.5; marker-line-opacity: 1; marker-placement: point; marker-type: ellipse; marker-width: 10; marker-fill: #FF6600; marker-allow-overlap: true; }

Slide 105

Slide 105 text

#table{ marker-fill-opacity: 0.9; marker-line-color: #FFF; marker-line-width: 1.5; marker-line-opacity: 1; marker-placement: point; marker-type: ellipse; marker-width: 22; marker-fill: #FF6600; marker-allow-overlap: true; }

Slide 106

Slide 106 text

#table{ marker-fill-opacity: 0.9; marker-line-color: yellow; marker-line-width: 3.5; marker-line-opacity: 1; marker-placement: point; marker-type: ellipse; marker-width: 22; marker-fill: #FF6600; marker-allow-overlap: true; }

Slide 107

Slide 107 text

lines use the same rules as the line borders of polygons

Slide 108

Slide 108 text

#table{ line-color: #FF6600; line-width: 2; line-opacity: 0.7; }

Slide 109

Slide 109 text

#table{ line-color: #FF6600; line-width: 15; line-opacity: 0.7; }

Slide 110

Slide 110 text

#table{ line-color: #FF6600; line-width: 15; line-opacity: 0.7; line-smooth: .5; }

Slide 111

Slide 111 text

#table{ line-color: #FF6600; line-width: 15; line-opacity: 0.7; line-smooth: 5.5; }

Slide 112

Slide 112 text

#table{ line-color: #FF6600; line-width: 15; line-opacity: 0.7; line-smooth: 5.5; line-dasharray: 5, 4; }

Slide 113

Slide 113 text

all of these are subject to composite operations. we’ll see in the hands on

Slide 114

Slide 114 text

Using rules

Slide 115

Slide 115 text

Any column in your table (or SQL result) can be used to define a rule

Slide 116

Slide 116 text

#table{ marker-fill-opacity: 0.9; marker-line-color: yellow; marker-line-width: 1.5; marker-line-opacity: 1; marker-width: 22; marker-fill: #FF6600; [atype = 'Specialized']{ marker-fill: white; } } ‘atype’ is a string column in my table

Slide 117

Slide 117 text

#table{ marker-fill-opacity: 0.9; marker-line-color: yellow; marker-line-width: 1.5; marker-line-opacity: 1; marker-width: 22; marker-fill: #FF6600; [atype = 'Specialized']{ marker-fill: white; } [atype = 'Institutional']{ marker-fill: green; } } ordered

Slide 118

Slide 118 text

#table{ marker-fill-opacity: 0.9; marker-line-color: blue; marker-line-width: 1.5; marker-line-opacity: 1; marker-width: 22; marker-fill: #FF6600; [atype = 'Institutional']{ marker-fill: green; [cartodb_id<12594]{ marker-line-color: red; } } } nested

Slide 119

Slide 119 text

#table{ marker-fill-opacity: 0.9; marker-line-color: blue; marker-line-width: 1.5; marker-line-opacity: 1; marker-width: 22; marker-fill: #FF6600; [is_valid = True]{ marker-fill: green; } } Boolean columns a slightly different in notation

Slide 120

Slide 120 text

Zoom as a parameter

Slide 121

Slide 121 text

#table{ marker-fill-opacity: 0.9; marker-line-color: blue; marker-line-width: 1.5; marker-line-opacity: 1; marker-width: 22; marker-fill: #FF6600; [zoom > 7]{ marker-line-width: 3; } } The zoom parameter

Slide 122

Slide 122 text

#table{ marker-fill-opacity: 0.9; marker-line-color: blue; marker-line-width: 1.5; marker-line-opacity: 1; marker-width: 22; marker-fill: #FF6600; [zoom > 7]{ marker-line-width: 3; [zoom > 8]{ marker-line-width: 6; } } } nested

Slide 123

Slide 123 text

A whole world of labels and text…

Slide 124

Slide 124 text

http://bit.ly/1rtx6pt

Slide 125

Slide 125 text

Client side CartoCSS | Torque

Slide 126

Slide 126 text

Client side CartoCSS | Torque

Slide 127

Slide 127 text

Map { -torque-frame-count:512; -torque-animation-duration:30; -torque-time- attribute:"cartodb_id"; -torque-aggregation- function:"count(cartodb_id)"; -torque-resolution:2; -torque-data- aggregation:linear; } The ‘Map’ object sets up the entire canvas and settings of your temporal visualization

Slide 128

Slide 128 text

Map { -torque-frame-count:512; -torque-animation-duration:30; -torque-time- attribute:"cartodb_id"; -torque-aggregation- function:"count(cartodb_id)"; -torque-resolution:2; -torque-data- aggregation:linear; } frame-count is how many temporal bins your data will be broken into. if you are visualizing 31 days, you wouldn’t need more than 31…

Slide 129

Slide 129 text

Map { -torque-frame-count:512; -torque-animation-duration:30; -torque-time- attribute:"cartodb_id"; -torque-aggregation- function:"count(cartodb_id)"; -torque-resolution:2; -torque-data- aggregation:linear; } duration is how long the animation will play for before looping back to the beginning

Slide 130

Slide 130 text

Map { -torque-frame-count:512; -torque-animation-duration:30; -torque-time- attribute:"cartodb_id"; -torque-aggregation- function:"count(cartodb_id)"; -torque-resolution:2; -torque-data- aggregation:linear; } time-attribute is the numerical or temporal column in your dataset that you want to order the animation by, beginning to end

Slide 131

Slide 131 text

Map { -torque-frame-count:512; -torque-animation-duration:30; -torque-time- attribute:"cartodb_id"; -torque-aggregation- function:"count(cartodb_id)"; -torque-resolution:2; -torque-data- aggregation:linear; } the aggregation- function is actually SQL! It is how you want data in the same spatial cell, in the same temporal bin, to be combined. here, you just get a raw value

Slide 132

Slide 132 text

Map { -torque-frame-count:512; -torque-animation-duration:30; -torque-time- attribute:"cartodb_id"; -torque-aggregation- function:"sum(population)"; -torque-resolution:2; -torque-data- aggregation:linear; } But here, you would get a totally different value. The result of this is an attribute called value that we can use to style with in our CartoCSS later

Slide 133

Slide 133 text

Map { -torque-frame-count:512; -torque-animation-duration:30; -torque-time- attribute:"cartodb_id"; -torque-aggregation- function:"count(cartodb_id)"; -torque-resolution:2; -torque-data- aggregation:linear; } resolution is the size of each pixel you will style

Slide 134

Slide 134 text

#table{ comp-op: lighter; marker-fill-opacity: 0.9; marker-line-color: #FFF; marker-line-width: 1.5; marker-line-opacity: 1; marker-type: ellipse; marker-width: 6; marker-fill: #FF9900; } Much of the CartoCSS for the rest looks the same as we saw before.

Slide 135

Slide 135 text

#table{ comp-op: lighter; marker-fill-opacity: 0.9; marker-line-color: #FFF; marker-line-width: 1.5; marker-line-opacity: 1; marker-type: ellipse; marker-width: 6; marker-fill: #FF9900; [value > 3]{ marker-fill-color: blue; } } We can use the value attribute from our aggregation function here to change styles though

Slide 136

Slide 136 text

#table[frame-offset=1] { marker-width:8; marker-fill-opacity:0.45; } We can also use frame-offsets ! frame-offsets allow you to draw the marker a second (or more times) after the frame it initially hits your maps.

Slide 137

Slide 137 text

You can update the CartoCSS of any layer in your visualizations with the setCartoCSS function (no line breaks) ! layer.setCartoCSS(“#tablename {marker- fill: red; }”); In CartoDB.js http://bit.ly/1vpF1pi

Slide 138

Slide 138 text

Maps, Lies & Storytelling Technology aside - Odyssey.js

Slide 139

Slide 139 text

hands on

Slide 140

Slide 140 text

Maps, Lies & Storytelling Guest speaker

Slide 141

Slide 141 text

Aurelia Moser Knight News Fellow Ushahidi / Internews http://aureliamoser.com/ Next week

Slide 142

Slide 142 text

Maps, Lies & Storytelling Discussion

Slide 143

Slide 143 text

Maps, Lies & Storytelling Assignments

Slide 144

Slide 144 text

Readings 5 Favorite Maps: Bill Rankin | http://bit.ly/1nrXEsV 15 Maps that explain ISIS | http://bit.ly/1pl02wx

Slide 145

Slide 145 text

I want you to show me the most far out way you can use CartoCSS and/or SQL to create a visualization. It can be a multistep process (UPDATEs, Table from Query), but be sure to document and share every step of your process. Assignment 1

Slide 146

Slide 146 text

Example 1

Slide 147

Slide 147 text

No content

Slide 148

Slide 148 text

No content

Slide 149

Slide 149 text

No content

Slide 150

Slide 150 text

No content

Slide 151

Slide 151 text

No content

Slide 152

Slide 152 text

Example 2

Slide 153

Slide 153 text

No content

Slide 154

Slide 154 text

Time to document your lie. Begin creating a comprehensive map and story of your lie. This should be a narrative story. During the narrative, you should highlight where your lie is exposed through maps. Assignment 2

Slide 155

Slide 155 text

Create a map to accompany a current news article or a current event. This should be an original map, not some improvement of a map included in the article Assignment 3

Slide 156

Slide 156 text

See you next week!