Classification of UK Mastermap buildings using the NISMOD-DB++ API and geometric properties.
This script uses the NISMOD-DB++ API to classify OS Mastermap buildings at local authority district (LAD) scale. The script extracts residential buildings using the API and, using topological properties between buildings and Addressbase points, classifies into one of four residential classes:
- Detached
- Semi-detached
- Terraced
- Flat
There are also Communal dwellings.
The script assigns a MISTRAL building class and posts the resulting data back to the NISMOD-DB++ database.
The script requires a 'init.txt' file to be located in the same directory. This should contain details for connecting to the NISOMD-DB++ API and required there to be three keys, user, password and url, each on their own line in the file. For example, the user line should look like: user="example_user"
shapely, requests, itertools, json