https://github.com/jgthms/buildings
All 9,866,539 buildings in the Netherlands, shaded according to year of construction.
https://github.com/jgthms/buildings
Last synced: 3 months ago
JSON representation
All 9,866,539 buildings in the Netherlands, shaded according to year of construction.
- Host: GitHub
- URL: https://github.com/jgthms/buildings
- Owner: jgthms
- Fork: true (bertspaan/buildings)
- Created: 2022-01-19T10:45:31.000Z (over 3 years ago)
- Default Branch: gh-pages
- Last Pushed: 2016-06-12T13:14:11.000Z (almost 9 years ago)
- Last Synced: 2024-10-01T05:41:28.813Z (7 months ago)
- Size: 26.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Buildings in the Netherlands by year of construction
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.
[](http://code.waag.org/buildings)
# License
## Software - scripts in this repository
MIT
## Map - building map, screenshots, high-res exports
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.# Make a similar map yourself
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](../../tree/gh-pages/sections) high-res PNG and PDF files.
## Download and import BAG data
Install PostgreSQL and PostGIS, download data from [NLExtract](http://nlextract.nl/) and import into database `bag`. Details can be found in [NLExtract's documentation](https://nlextract.readthedocs.org/en/latest/bagextract.html).
## Create buildings table
To create a map with buildings by year of construction (or area and function), execute the following SQL:
```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);
```## Create TileMill project and map tiles
Install [TileMill](https://www.mapbox.com/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`](../../tree/gh-pages/sections) directory of this repository.