-
Notifications
You must be signed in to change notification settings - Fork 0
Importing Building Footprints
You must have access to building footprints to use the Colouring Cities platform. The user enters data into the system using these footprints to 'colour' the city.
- Here is a page where you can add information on your building footprint sources to help others.
There are other methods for configuring these footprints, but these are the steps that have been used to initialise other Colouring Cities platforms and the steps that our engineers will follow if we set up your platform for you.
The best format for importing building footprints into the Colouring Cities platform is to export them in GEOJSON format.
We prefer that building footprints are available under an open license. However, it is possible to use footprints on a more restrictive license with the platform. The footprints are kept behind a firewall and are only used to colour the maps on the platform, it is not possible to extract and download them from the platform.
The footprints should be exported using the GeoJSON format, a commonly used data format. The file should have shapes defined as Polygons and MultiPolygons; all other shapes (including points, lines, etc.) will be ignored.
For convenience, we have written a Python File to generate an SQL script to set up the footprints in your Colouring Cities application's database. This script has been added to the Core platform in the configuration/generate_footprint_import_sql.py
.
NOTE: We are working on updating this script to make it easier to use - please let us know if you have any problems using it!
To run this Python code, you will need to edit the file to:
- specify the INPUT_DIRECTORY & INPUT_FILENAME parameters to specify the location of the
.geojson
file that contains the building footprints, - edit the
location_code()
function to specify the location code of the footprints you want to import.- For example,
lbx
is the location code for the area around Loughborough,sgp
is the code for Singapore etc.
- For example,
You may need to edit other parts of this code, depending on the format of the footprints. Contact Mateusz if you need help with this.
Once you have edited the Python file, run it and it will generate an SQL script (default generate_footprints.sql
).
Next, you will need to connect to your database and then execute the SQL script. The footprints should then be ready to use and you should be able to interact with them on your version of the Colouring Cities platform.
Make sure you have updated the 'bbox' in app/src/cc-config.json
to a bounding box that includes the area you want to render. The best way to do this is to use a website like bboxfinder.com. For example, this link shows the bounding box that was used on the Colouring Singapore platform. If the buildings are outside this bounding box, they will not be rendered by the application.
Note: use the "EPSG:3857 - WGS 84 / Pseudo-Mercator" tab at the bottom of the screen to get the coordinates in the correct format.