Welcome to Advanced Interactive Web Mapping, Programming, and Design, Class 12
This is a web page that can be viewed as slides.
→ to move forward
← to go back
Advanced Interactive Web Mapping, Programming, and Design
Class 12
remember: we're not meeting next week
see you Monday May 9th
since many Turf functions return GeoJSON objects, you can run another Turf function on the returned object
var convex = turf.convex(points);
var buffered = turf.buffer(convex, 150, 'feet');
each new feature will have a countField property with the count
you set countField as a parameter
for example
turf.count(polygons, bodegaPoints, 'bodegaCount');
counting points in polygons
jsbin
load points
load polygons
var polygonsWithCounts = turf.count(points, polygons, 'count');
L.geoJson(polygonsWithCounts).addTo(map);
trying to style polygons based on those counts
jsbin
load points
load polygons
var polygonsWithCounts = turf.count(points, polygons, 'count');
find the maximum count
L.geoJson(polygonsWithCounts).addTo(map, {
style: function (feature) {
vary something by count and maximum count
}
});
load points
load polygons
var polygonsWithCounts = turf.count(points, polygons, 'count');
find classes by count
L.geoJson(polygonsWithCounts).addTo(map, {
style: function (feature) {
vary something by classes
}
});
call Parks and say "where's our park?"
What is urban renewal?
Urban
Renewal
so let's map them!
we weren't the first to have this idea
Community Development Program Progress Report (1968)
Atlas of Urban Renewal (1984)
what will it take?
what will it take?
- get the data
- clean the data
- merge the data with other useful datasets
FOIL
FOILed!
thanks to amazing volunteers
tiles created via OpenStreetMap and Mapbox
~10,000 polygons
6 MB
not particularly fast
list plans
outline plans
search for plans
highlight parcels
CartoDB
- Leaflet
- Mapbox tiles
- CartoDB layer on top with cartodb.js
making it interactive
making it interactive
SELECT name
FROM plans
WHERE name ILIKE '%lincol%'
ST_Union, ST_ConvexHull, ST_Buffer
yeah we use the SQL API here too
1. construct SQL query to find the lot you're over
2. get GeoJSON and add to map
dynamic styles
dynamic styles
setCartoCSS()
create a string with the CartoCSS you want to use
code
dynamic data
dynamic data
setSQL()
each of these is a page hosted on GitHub Pages
we wanted collaborators to edit the pages without using HTML
plain text or markdown → HTML
jekyll
and we don't want to teach everyone GitHub
code