Welcome to Advanced GIS, Lecture 2
This is a web page that can be viewed as slides.
→ to move forward
← to go back
where you import, edit, and analyze your data
you can upload:
where you make public map views of your datasets
(it's just text)
Looks similar to but is otherwise completely separate from CSS.
Looks similar to but is otherwise completely separate from CSS.
CSS adds style (line thickness, color) to webpages, CartoCSS does the same for maps.
#earthquakes {
marker-fill: #ff307a;
marker-line-color: #FFF;
marker-line-width: 0.25;
marker-line-opacity: 0.4;
marker-width: 2;
marker-allow-overlap: true;
}
#earthquakes {
marker-fill: #ff307a;
marker-line-color: #FFF;
marker-line-width: 0.25;
marker-line-opacity: 0.4;
marker-width: 2;
marker-allow-overlap: true;
}
#earthquakes
#earthquakes
"this statement will talk about the layer called earthquakes"
#earthquakes {
#earthquakes {
}
#earthquakes {
}
otherwise your statement will never end!
#earthquakes {
marker-fill: #ff307a;
}
#earthquakes {
marker-fill: #ff307a;
}
always one per line, each line ending with a ;
#earthquakes {
marker-fill: #ff307a;
marker-line-color: #FFF;
}
#earthquakes {
marker-fill: #ff307a;
marker-line-color: #FFF;
}
#earthquakes {
marker-fill: #ff307a;
marker-line-color: #FFF;
marker-line-width: 0.25;
marker-line-opacity: 0.4;
marker-width: 2;
marker-allow-overlap: true;
}
#earthquakes {
marker-width: 3;
[zoom >= 10] {
marker-width: 8;
}
}
#earthquakes {
marker-width: 3;
[zoom >= 10] {
marker-width: 8;
}
}
"make the earthquakes markers 3 pixels wide. if the map is at zoom level 10 or higher, make the earthquakes markers 8 pixels wide."
#earthquakes {
marker-width: 3;
[zoom >= 10] {
marker-width: 8;
}
[zoom >= 16] {
marker-width: 13;
}
}
#earthquakes {
marker-width: 3;
[mag >= 5.5] {
marker-width: 8;
}
}
#earthquakes {
marker-width: 3;
[locationsource = 'pr'] {
marker-width: 8;
}
}
#earthquakes {
marker-width: 3;
[mag > 5.5],
[locationsource = 'pr'] {
marker-width: 8;
}
}
shortcut for:
#earthquakes {
marker-width: 3;
[mag > 5.5] {
marker-width: 8;
}
[locationsource = 'pr'] {
marker-width: 8;
}
}
#earthquakes {
marker-width: 3;
[mag > 5.5],
[locationsource = 'pr'] {
marker-width: 8;
}
}
#earthquakes {
marker-width: 3;
[mag > 5.5][locationsource = 'pr'] {
marker-width: 8;
}
}
#earthquakes {
marker-width: 3;
[mag > 5.5][locationsource = 'pr'] {
marker-width: 8;
}
}
make markers where mag is greater than 5.5 and locationsource = "pr" larger
[mag >= 5.5] {
}
[mag >= 5.5][mag < 7] {
}
both conditions must be true
[mag >= 5.5],
[zoom >= 10] {
}
either condition could be true
#earthquakes {
[mag >= 7] {
}
[zoom >= 11] {
}
[zoom >= 12] {
}
}
#earthquakes[mag >= 7] {
}
#earthquakes[zoom >= 11] {
}
#earthquakes[zoom >= 12] {
}
#earthquakes {
marker-width: 5;
marker-fill: #ff307a;
marker-allow-overlap: true;
[zoom >= 4] {
marker-width: 10;
}
[zoom >= 8] {
marker-width: 15;
}
[zoom >= 12] {
marker-width: 20;
}
}
#earthquakes {
marker-width: 6;
marker-fill: #ff307a;
marker-allow-overlap: true;
[zoom >= 4] {
marker-width: 12;
}
[zoom >= 8] {
marker-width: 18;
}
[zoom >= 12] {
marker-width: 24;
}
}
@width: 6;
#earthquakes {
marker-width: @width;
marker-fill: #ff307a;
marker-allow-overlap: true;
[zoom >= 4] {
marker-width: 12;
}
[zoom >= 8] {
marker-width: 18;
}
[zoom >= 12] {
marker-width: 24;
}
}
@width: 6;
#earthquakes {
marker-width: @width;
marker-fill: #ff307a;
marker-allow-overlap: true;
[zoom >= 4] {
marker-width: @width * 2;
}
[zoom >= 8] {
marker-width: @width * 3;
}
[zoom >= 12] {
marker-width: @width * 4;
}
}
@width: 8;
#earthquakes {
marker-width: @width;
marker-fill: #ff307a;
marker-allow-overlap: true;
[zoom >= 4] {
marker-width: @width * 2;
}
[zoom >= 8] {
marker-width: @width * 3;
}
[zoom >= 12] {
marker-width: @width * 4;
}
}
@earthquakecolor: #ff307a;
#earthquakes {
marker-width: @width;
marker-fill: @earthquakecolor;
marker-line-color: @earthquakecolor;
marker-line-opacity: 0.2;
marker-allow-overlap: true;
}
@earthquakecolor: #ff307a;
#earthquakes {
marker-width: @width;
marker-fill: fadeout(@earthquakecolor, 25%);
marker-line-color: @earthquakecolor;
marker-line-opacity: 0.2;
marker-allow-overlap: true;
}