View map on http://code.waag.org/buildings.
Map showing all 9,866,539 buildings in the Netherlands, shaded according to year of construction. Data from BAG, via CitySDK. Map made with TileMill by Bert Spaan, Waag Society, inspired by BKLYNR.
MIT
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
The map is made with open data and open source software only. This section of the README explains how to get the data, create the map and export high-res PNG and PDF files.
Install PostgreSQL and PostGIS, download data from NLExtract and import into database bag
. Details can be found in NLExtract's documentation.
To create a map with buildings by year of construction (or area and function), execute the following SQL:
DROP SCHEMA tilemill;
CREATE SCHEMA tilemill;
CREATE TABLE tilemill.buildings AS
SELECT
p.identificatie::bigint, p.bouwjaar::int AS year,
ST_Transform(p.geovlak, 4326) AS geom,
round(mode() WITHIN GROUP(order by v.oppervlakteverblijfsobject)) AS oppervlakte,
mode() WITHIN GROUP(order by vg.gebruiksdoelverblijfsobject::text) AS gebruiksdoel
FROM bagactueel.verblijfsobject v
JOIN bagactueel.verblijfsobjectpand vp
ON vp.identificatie = v.identificatie
JOIN bagactueel.pand p
ON vp.gerelateerdpand = p.identificatie
JOIN bagactueel.verblijfsobjectgebruiksdoel vg
ON v.identificatie = vg.identificatie
GROUP BY
p.identificatie, p.bouwjaar, p.geovlak;
CREATE INDEX buildings_geom_idx
ON tilemill.buildings
USING gist (geom);
Install TileMill, copy the contents of the tilemill
to your local TileMill projects directory (usually ~/Documents/MapBox/project
), or create a symbolic link. The TileMill project file connects with PostgreSQL using user postgres
and password postgres
. Edit project.mml
to change user and password.
A script to export high-res images is available in the sections
directory of this repository.