Skip to content

Instantly share code, notes, and snippets.

@andrewxhill
Last active January 3, 2016 06:29
Show Gist options
  • Save andrewxhill/8422832 to your computer and use it in GitHub Desktop.
Save andrewxhill/8422832 to your computer and use it in GitHub Desktop.
DataKind mapping crash course

Short link to this document http://bit.ly/Kh6TbW

Data for today's course is available from Nijel.org. Instead of downloading the data locally, we are just going to copy the URL to the public CSV of data, http://nijel.org/nysewage/ssoreports.csv. Select the URL http://nijel.org/nysewage/ssoreports.csv and copy to your clipboard.

Importing data

There are a few options in CartoDB for adding data to your account.

  1. Drag and drop files to your dashboard (CSV, KML, SHP, etc.)
  2. Paste URLs into the import menu
  3. Use the file import API (see documentation.cartodb.com)
  4. Write data with SQL using the dashboard or API (see documentation.cartodb.com)

Bubble Map

  1. Sizing and customizing style
  2. Quick look at comp op

Infowindows

  1. Adding
  2. Advanced editing

CartoCSS

	#ssoreports [ volume_gallons = null] {
	   marker-fill:  white;
	   marker-opacity: 0.4;
	   marker-comp-op: dst-over;
	}

Multilayer

  1. Importing from common data
  2. Labels
  3. Combining layers

Imgur

Wrap-up

See a version of the map live here, http://bl.ocks.org/andrewxhill/raw/8422832/

Extra resources

Map Academy

Learn along with us in these free, live, monthly courses.

http://academy.cartodb.com/

CartoDB Documentation

See a lot of great material here, including videos and writen content.

http://developers.cartodb.com/tutorials.html

GIS StackExchange

The best place to get answers to your technical questions is through the GIS StackExchange. Tag your questions with the cartodb tag and they get answered pretty quick!

http://gis.stackexchange.com/questions/tagged/cartodb

Useful Spatial SQL

There is a ton of useful SQL out there. I put together some fun examples using the tornadoes dataset availabel from the first class of the Map Academy.

https://gist.github.com/andrewxhill/7862128

<!DOCTYPE html>
<html>
<head>
<title>DataKind Workshop | Demo</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<style>
html, body, iframe {
height: 100%;
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<iframe width='100%' height='100%' frameborder='0' src='http://andrew.cartodb.com/viz/fe253d80-7d43-11e3-9be7-3085a9a9563c/embed_map?title=true&description=true&search=false&shareable=true&cartodb_logo=true&layer_selector=false&legends=false&scrollwheel=true&sublayer_options=1&sql=SELECT%20*%20FROM%20ssoreports%20ORDER%20BY%20volume_gallons%20DESC&sw_lat=40.53050177574321&sw_lon=-81.4306640625&ne_lat=44.49650533109345&ne_lon=-70.8837890625'></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment