DSSG has partnered with the Municipality of Rotterdam to identify green rooftops in Rotterdam for a given Area of Interest (AoI). In our case, the AoI was the city center.
To achieve this goal, we build a multi-class classification model for rooftops in Rotterdam, classifying them in ‘non-vegetation’, ‘vegetation,’ and ‘trees.’ Our model is used to produce three deliverables for the Municipality of Rotterdam:
-
a ‘Raw Table’ with the predicted classification for each rooftop in AoI, including its prediction probability and corresponding area in square meters;corresponding area in square meters;
-
a ‘Summary Table,’ which is a ‘Raw Table’ grouped by type of classification; information is displayed in by area and by rooftop; and,
-
a ‘Visualization’ that identifies the predicted classifications in a map of the AoI with colored shapefiles for each building footprint (i.e., grey, light green, and dark green for non-vegetation, vegetation, and trees, respectively); this file can be opened with QGIS, a free and open source geographic information system software.
To set up a Python environment, go to https://conda.io/miniconda.html. Choose the Miniconda installer (Python 3.6) according to your operating system.
Once Miniconda is installed, use the ‘conda’ command to create an environment called ‘green-roofs’ with the file ‘environment.yml’. When you create an environment or install package, conda will ask you to proceed (i.e., ‘proceed ([y]/n)?‘). Type ‘y’.
To create the environment and install the necessary packages, open the terminal inside folder '0_install' and type:
- For Windows: ‘conda env create -f win_environment.yml -n greenroofs’;
- For Linux/macOS: ‘conda env create -f unix_environment.yml -n greenroofs’.
To activate the environment, type ‘activate greenroofs’ (Windows) or ‘source activate greenroofs’ (Linux/macOS). To deactivate the environment, type ‘deactivate’ (Windows) or ‘source deactivate’ (Linux/macOS).
You now have a working Python environment.
-
Open the terminal and activate the environment;
-
Open ‘create_features.py’:
- Set ‘BAG_Panden’ to the file with the building footprint polygons;
- Set ‘CIR’ to the file with the color-infrared imagery;
- Save ‘create_features.py’;
-
Run ‘create_features.py’ (i.e., type ‘python create_features.py’ in the command line);
-
Open ‘classify.py’ and:
- Save the IDs within the selected area of interest as ‘aoi_ids.csv’ and set it as the variable ‘AoI’;
- Save ‘classify.py’; and,
-
Run ‘classify.py’ (i.e., type ‘python classify.py in the command line’).
This project was conducted as part of Data Science for Social Good (DSSG) Europe 2017 fellowship in partnership with the Municipality of Rotterdam.
Student Fellows: Tiago Louro Alves, Diogo Conceição, Carlos Gonçalves, and João Louro
Technical mentor: Rodrigo Belo, Qiwei Han
Project manager: N. Gizem Bacakhesizlar, João Dinis Fernandes