ISM CARTO Workshop Análisis y visualización de datos ambientales con CARTO
- Trainer: Ramiro Aznar · ramiroaznar@carto.com · @ramiroaznar
- November 11th, 2016
- Data Analysis and Visualization for environmental professionals
- Instituto Superior de Medio Ambiente (ISM) event
- http://bit.ly/161011-ism-carto
Introduction
Prerequisites
- Laptop
- A modern browser (Google Chrome would be perfect)
Map Academy, tutorials and other online resources
You can take a look on those resources if you want to warm up with CARTO
Further questions and troubleshooting
- Email to support@carto.com.
- Some questions could be already anwered at GIS Stack Exchange
carto
tag.
Contents
Accounts set up
- The instructor will provide you a user and passwor to access your account
- Log into your
ismcartoXX
account going tohttps://ismcartoXX.carto.com
Introduction to CARTO
Slides available here.
Builder
The BUILDER is the new main web interface to interact with the CARTO platform. It’s a product aimed to everyone willing to manage, analyze and visualize geospatial information. It’s highly focused on usability, with a friendly graphical interface that unlocks all the power of the CARTO ENGINE without having to know all the details on underlying technologies such as PostGIS or CartoCSS.
Demo
With this demo we want to answer the following question: what is the river more polluted within the Comunidad de Madrid?
1. Import datasets and create a map
1. 1. Import datasets into CARTO
- Download the following datasets* from the
builder-demo
account:vertidos
(as csv file), pollution point sources.rios
(as shapefile file), Spanish rivers.subcuencas
(as shapefile), small Spanish rivers watersheds.
-
Import the three datasets (one by one) into your CARTO account.
- Select
vertidos
,rios
andsubcuencas
from your datasets dashboard, click onNEW MAP
.
*These datasets were previously download from the MARM website.
1. 2. Rename map title and layers
- Rename map title to
Vertidos, ríos y subcuencas
. - Order the layers: first
vertidos
, thenrios
and at the bottom,subcuencas
. - Rename layers:
vertidos
asVertidos
,rios
asRíos
,subcuencas
asSubcuencas
.
2. Style Vertidos
layer and add your first widgets
2. 1. Add your first widgets
- Click on
Vertidos
layer. - On the
DATA
taba, you will be able to see an overview of all the fields that this layer contains.- Activate the checkbox of
points count
. - Click on
EDIT
. - Rename the widget as
Número de vertidos
.
- Activate the checkbox of
This widget is a formula which counts the number of points (vertidos) within the visualization bounding box. Try to add a widget which filters rivers by name.
2. 1. Style Vertidos
layer
- Back to the main menu, in order to style
Vertidos
layer follow these steps:- Click on
Vertidos
layer. - Click on the
STYLE
tab. - Click on the number 7 next to
FILL
and set the marker size toBY VALUE
. - Select
volumen_m
. Leave the min and max default values. - Click on the color bar and set the
opacity
to0.5
. - Set the
STROKE
to0
.
- Click on
You have just created a bubble map! Larger points are “vertidos” with higher “volumen”, and smaller points are “vertidos” with lower “volumen”.
2. Filter rivers by watersheds
2. 1. Connect Rios
and Subcuencas
layers
- In order to connect these two datasets, we need a common field. In our case,
cod_demar
. Then, we need to apply theFilter by layer
analysis. Please, follow these steps:- Back to the main menu, click on
Rios
layer. - Click on
ANALYSIS
tab. - Click on
ADD NEW ANALYSIS
. - Select
Filter by layer
analysis. Click onADD ANALYSIS
. - Set the parameters as follow:
FILTER BY LAYER
:Subcuencas
.SOURCE COLUMN
:cod_demar
.FILTER COLUMN
:cod_demar
.
- Click on
APPLY
.
- Back to the main menu, click on
2. 2. Add a widget in order to filter Rios
by Subcuencas
- You have both layers connected by the
cod_demar
. Now you would only need to add a category widget for filtering by this field:- Back to the main menu, click on
Subcuencas
layer. - Activate the checkbox of
cod_demar
. - Click on
EDIT
. - Rename the widget as
Demarcación
.
- Back to the main menu, click on
- Because we are only interested on the rivers that crosses the Comunidad de Madrid where the “vertidos” are located, we will click on
31
value (Tajo river watershed).
3. Intersect Vertidos
points with areas of influence from every Rio
3. 1. Create areas of influences
- Back to the main menu, in order to improve the visualization, disable the view of the
Subcuencas
layer. - Then click on
ADD ANALYSIS
just below theRio
layer.- Select
Create areas of influence
. Click onADD ANALYSIS
. - Set the
RADIUS
parameter to500
meters. - Click on
APPLY
.
- Select
You can check how dynamically the analysis is run by BUILDER changing the
RADIUS
parameter.
3. 2. Intersect Vertidos
points and get aggregate values
- You do not need to go back to run a new analysis. Just click on the
+
sign to concatenate a third and last analysis to theRíos
layer:- Select
Intersect with second layer
analysis. Click onADD ANALYSIS
. - Set the parameters as follow:
TARGET LAYER
:Subcuencas
.OPERATION
:SUM(volume_m)
.
- Click on
APPLY
.
- Select
- Go back, to the main menu. Click on
Ríos
layer and check the new columnsum_volume_m
in the table view.
3. 3. Add an histogram widget to explore volume of Vertidos
per Ríos
- Back to the main menu, click on
Ríos
layer.- Activate the checkbox of
sum_volume_m
. - Click on
EDIT
. - Rename the widget as
Volumen (m3) per river
.
- Activate the checkbox of
Could you answer the question?
3. 4. Color Ríos
layer by Volumen
of Vertido
- Back to the main menu, in order to style
Vertidos
layer follow these steps:- Click on
Ríos
layer. - Click on the
STYLE
tab. - Click on the color bar next to
FILL
and set the polygon fill toBY VALUE
. - Select
sum_volumen_m
. - Choose a color palette and set the number of buckets to
5
. - Click on the color bar and set the
opacity
to0.7
. - Set the
STROKE
to0.2
.
- Click on
- The same intersect analysis can be done to the
Subcuencas
layer:
3. 5. Share your analysis and visualization!
- In order to publish your results, back to the main menu and click on
SHARE
. - Click on
PUBLISH
(change fromPrivate
toPublic
if need). - Copy the link and share it via email, Twitter, LinkedIn or your favorite social network.