Oct 14, 2016
Andy Eschbacher, [email protected], @MrEPhysics
This link is here: http://bit.ly/carto-data-sci-oct14
- It depends on how you use it ;)
- Geo data matters
- Urban Reviewer
- Tweets mentioning sunrise
- Carto Calculator
- Evictions in San Francisco
- L Train project
- Other projects
- NYC Henge
- Animated maps to compliment analysis: http://toddwschneider.com/posts/analyzing-1-1-billion-nyc-taxi-and-uber-trips-with-a-vengeance/
- Our L Train analysis: https://carto.com/blog/looking-at-the-l/
- Ben Wellington:
First we need to sync a new dataset. Search for "usgs earthquake spreadsheet" to find the page, or use the following dataset of all recorded seismic events from the past 30 days:
http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.csv
This is updated every 15 minutes, so it's a great candidate for making a map which updates based on measurements in the world. Let's import that into our accounts. Even cooler: the map we publish will be updated automatically, and the underlying analysis changes dynamically based on the new points added to the dataset.
To build our analysis workflow, let's focus on the output we would like.
Visualize significant, recent earthquake events by communicating the total population who are living within 50 miles of the epicenter.
We can build this analysis workflow in the Builder by chaining together some of the tools.
- We need to restrict our analysis to California (within 50 miles of the borders)
- Filter to only show significant events
- Find the number of people living with 50 miles of the earthquake events
- Visualize the points by the number of people (proportional symbol map)
There are many ways to get the boundary of California. One ways is just grab all the states from Natural Earth Data. Another ways is to grab it from my CARTO account:
Copy that link, and import it just like you did for the earthquake dataset above. Finally, we can do some Analysis with the Builder to get it into the state that we're interested in (50 miles outside of current borders).
We can again use the Builder to find all earthquakes which intersect California or are within 50 miles of its border by using the "Aggregate intersection" method.
Using the "Filter by column value" analysis method, we can surface only the significant earthquakes (by magnitude).
Using the "Create areas of influence" tool, we can get the regions that are within a 50 mile distance of the epicenter of an earthquake.
This analysis allows us to attach valuable information from sources such as the US Census. For our demo we will use Total Population that are within 50 miles of the epicenter of the earthquakes.
- Get on GitHub Student Developer Packs if you can
- "student accounts": https://carto.com/signup?plan=academy
- SQL API (write sql, get data via HTTP requests)
- Data Services API
- Geocoding, routing, etc.
- Nice demos here: https://carto.com/location-data-services/
- Data Observatory API
- Functions for getting measures (World censuses, Zillow, etc.)
- Functions for getting boundaries
- Catalog of available data: https://cartodb.github.io/bigmetadata/index.html
- Find things like median income at our location:
SELECT OBS_GetMeasure(CDB_LatLng(40.7529671,-73.9927947), 'us.census.acs.B19013001'::text)
- Explain Subway stops: https://jkrauss.carto.com/builder/18644096-65c3-11e6-adbe-0ee66e2c9693/embed
- Maps API
- For fetching map tiles for use with Google Maps API, Leaflet.js, OpenLayers, etc.
- Generating dynamically made image previews (aka, static maps)
- For example: http://mamataakella.carto.com/api/v1/map/static/named/tpl_25aaad68_7134_11e6_afae_0e3ebc282e83/1600/1600.png?zoom=5&lat=40.7529777&lon=-73.994722
- Import API
- Send data to your CARTO account
- Setup sync tables (responsive to upstream changes to data so you can create dynamic maps)
- Spatial Analysis
- geo-statistics using PySAL, scikit-learn, and others
- tons more coming soon
- Carto.js -- workhorse library for building custom applications off of CARTO's platform
- Torque.js -- create spatio-temporal maps from your time-series data
- r2cartodb: https://rpubs.com/walkerke/r2cartodb
- CARTO's Python Client: https://github.com/CartoDB/carto-python
- R's
read.csv
and Panda'sread_csv
work with our SQL API when theformat
flag is set tocsv
- Format:
http://eschbacher.carto.com/api/v2/sql?q=SELECT * FROM awesome_table&format=csv
- Use with Plotly: https://plot.ly/ipython-notebooks/cartodb/
- Format:
- DC Elevation App -- see index.html on this gist
- Charts!
- We made this at a little meetup I run last week