Welcome to Advanced GIS, Lecture 4
This is a web page that can be viewed as slides.
→ to move forward
← to go back
Class 4
readings in assignment
#airbnb {
marker-width: 3;
...
[zoom >= 10][zoom < 16] {
marker-width: 8;
}
}
#airbnb {
marker-width: 3;
...
[neighbourhood = 'Bedford-Stuyvesant'],
[neighbourhood = 'Bushwick'] {
marker-width: 8;
}
}
@width: 8;
#airbnb {
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;
}
}
Class 4
you need HTML and CSS. we'll get there.
Give me the pages that refer to properties in Brooklyn.
Give me the addresses of the properties in Brooklyn.
Give me the addresses of the properties in Brooklyn that have been built on since 1950.
just list the columns. for example:
SELECT students, teachers FROM education
these conditions are the same as the ones in CartoCSS:
> < = != >= <=
for example:
SELECT * FROM education WHERE students > 100
for example:
SELECT *
FROM education
WHERE students > 100
AND students < 200
get just the education with students between 100 and 150
for example:
SELECT * FROM education WHERE NOT (students > 100 OR op_type = 'religious')
get just the education features with students not between 100 and 150
count matching rows:
SELECT COUNT(*) FROM education WHERE students > 100 OR op_type = 'religious'
get the number of education features with students between 100 and 150
SELECT trick: add "columns" to your selectionSELECT *, 5 FROM education
SELECT *, stdnt_fem / students FROM education
SELECT *,
(stdnt_fem / students) * 100
FROM education
SELECT *,
(stdnt_fem / students) * 100
AS stdnt_fem_per
FROM education
UPDATE education SET size = 'large' WHERE students > 2500
DELETE FROM education WHERE ...
SELECT *,
(stdnt_fem / students) * 100
AS stdnt_fem_per
FROM education
SELECT *, ST_area(the_geom)
FROM kiberaboundary
SELECT *,
ST_area(ST_transform(the_geom_webmercator, 21036))
FROM kiberaboundary
SELECT education.* FROM education, kiberaboundary WHERE kiberaboundary.name = 'Silanga' AND ST_within(education.the_geom, kiberaboundary.the_geom)
data that is:
data that is:
data that is:
started in 2004 in the UK
started in 2004 in the UK
first State of the Map conference in 2007
started in 2004 in the UK
first State of the Map conference in 2007
over 1 million registered users in 2013
Open Database License (ODbL)
are just shapes with no meaning until you give them attributes, as in any GIS
a table wouldn't work because:
a table wouldn't work because:
a table wouldn't work because:
key-value pairs
leisure=park
name=Union Square West
we make them up as we go.
we make them up as we go. really.
a collaborative system of categorization
but if you want your data to be useful (and show up on maps!), you should try to be consistent with the community
mapzen.com/metro-extracts
"a tool to help you create a multi-page atlas of anywhere in the world"
get data in OSM:
you'll have to do some extra work to get the data in a useful format
get data out of OSM:
"In the intense density of Kibera, selecting which features are 'important' is a judgment call and a matter of interest."
Map Kibera Blog
HOT in coordination with: