Skip to content

Instantly share code, notes, and snippets.

@mehak-sachdeva
Last active April 12, 2017 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mehak-sachdeva/0535264aa0b1134cfc9fcf119dbe63f1 to your computer and use it in GitHub Desktop.
Save mehak-sachdeva/0535264aa0b1134cfc9fcf119dbe63f1 to your computer and use it in GitHub Desktop.

Mapping Asian diasporic art

<03.24.2017>

Grab this page here: http://bit.ly/gis-with-humanities

Me, Jr. Map Scientist at Carto

Intro

Accounts at Columbia

Columbia has a CARTO site license where you get primo accounts :) If you don't have an account on this already, head to:

https://columbialibraries.carto.com/signup

Make sure to use your columbia.edu email address to signup.

Builder vs. Editor

CARTO is in the middle of upgrading all accounts from our old product (Editor) to the current one (Builder). If your account looks different from ours, let us know and we'll get you upgraded.

Using CARTO you can:

  • easily overlay data onto a map
  • analyze the data to reveal spatial patterns
  • tell stories by creating beautiful visualizations
  • and then share them with the world!

CARTO combines

Add it up and you roughly get CARTO.

Diagram of CARTO's architecture

Structure of CARTO

Open source

Look at our code! Find the errors bugging you, improve it, be a part of a community.

http://github.com/CartoDB/cartodb

Intro to Builder

Welcome to Carto Builder!

Session I:

A peek at the map for this session: MOMA Artists Map

moma

The source for this dataset is from the repository from MOMA.

Download the Dataset for this session HERE

  • Style
  • Animated Styling

screen shot 2017-03-27 at 12 19 48 pm

  • Connect with Lines

screen shot 2017-03-27 at 12 30 30 pm

Session II:

Method A -

Shapefiles here:

Illinois block groups

Cook county race

A peek at the map for this session: Cook County, Illinois - Race

screen shot 2017-03-27 at 1 00 00 pm

Analysis Used : Join Columns from Second Layer

  1. Cleaning Started with this file: ACS_15_5YR_B02001_with_ann.csv

  2. Joining:

screen shot 2017-03-27 at 1 01 55 pm

screen shot 2017-03-27 at 1 11 18 pm

  1. Calculations:

Within the SQL tray type:

UPDATE race_cook_county
SET aa_per = (estimate_total___black_or_african_american_alone:: float / estimate_total:: float) * 100
WHERE estimate_total != 0
  1. Styling:

screen shot 2017-03-27 at 1 04 03 pm

  1. Widgets:

screen shot 2017-03-27 at 1 08 20 pm

Method B -

Using Data Observatory: Tool

Catalog

Quick trick: From your Illinois shapefile in the SQL tray apply:

SELECT * FROM cb_2015_17_bg_500k
WHERE countyfp = '31'

OR

Just grab it here: Shapefile

Analysis Used: Data Observatory

Steps:

screen shot 2017-03-27 at 1 27 48 pm

screen shot 2017-03-27 at 1 30 39 pm

Finally:

screen shot 2017-03-27 at 1 31 58 pm

Questions? :)

-------------

More Details:

How CARTO fits into the webmapping landscape

Web Maps

  • Before we dive into CARTO, let's talk a little bit about web maps
  • When we talk about web maps, we are referring to a few different components:
    • the map (a.k.a., basemap)
    • the data overlay
    • and the interface that the map sits in

What's a webmap?

Basemap

A map that provides geographic context to help support a wide variety of overlays-typically raster tiles (pngs, jpegs, etc.).

Stamen Tiles

Map tiles

The dimensions are 256x256 (or 512x512 for higher resolution) pixels and organized based on coordinates (x, y) and zoom levels (z).

tiles

There are also vector tiles: Google Maps, Mapbox, Mapzen

Zoom levels

Defines the scale of the current map view. Ranges from 0 (entire world) to 21 (individual building level).

zoom level what you see
0 whole world from a ways away
1 whold world closer
4 north america
7 north east united states
8 new york state
10 new york area
12 new york city
14 manhattan
16 upper west side
18 south lawn
20 avery building

Let's look at a tile

http://www.openstreetmap.org

Tile URL

tile url

Free or custom?

openstreetmap

vs.

strava

There are tons of free ones: http://leaflet-extras.github.io/leaflet-providers/preview/

And you can design your own:

The Data Layer

Themes of information overlaid on a basemap that help tell a story--typically vector.

basemapoverlay

How do we interact with the overlay?

Javascript/HTML/CSS for rendering on the web. E.g., D3.js generates SVGs (which can be parts of a map!) and manipulates them.

With these languages you can publish your map with the basetiles loaded and your data layers appropriately geocoded; with JavaScript you can also add to the interactivity of your map, revealing metadata in the tooltips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment