Occupancy in the University of Cambridge
This repo explains how to use CAD files (.dwg
) from the Estates division in the University of Cambridge to create a floor-aware application in ArcGIS Pro via the Indoors add-on. This repository assumes some understanding of Python programming as well as understanding of AutoCAD and ArcGIS Pro.
Prerequisites
- AutoCAD 2025
- ArcGIS Pro 3.4.3 or later
- ArcGIS for AutoCAD
- Python>=3.13
Set-up Process
- Make sure all the prerequisites are installed and working.
- Create a data folder that reflects this structure:
+---input
| \---Site
| +---Building 1
| First Floor.dwg
| Second Floor.dwg
| Third Floor.dwg
| +---Building 2
| First Floor.dwg
| Second Floor.dwg
+---output
| \---Site
| +---Building 1
| +---Building 2
- Create a
.env
file in the root directory of the project. This file should contain the following variables:
DATA_DIR = "Path to the data folder"
From here the workflow splits into two, depending on whether the process is using AutoCAD or ArGIS Pro.
AutoCAD
- Create a Python environment using uv and the pyproject.toml file in the root directory of the project. This can be done using the command:
uv sync
This will create a .venv folder in the root directory of the project. This folder contains all the dependencies needed to run the code.
- Activate the environment in the terminal using the command:
.\venv\Scripts\activate
ArcGIS Pro
-
Duplicate the ArcGIS Pro default conda environment following these instructions by Esri.
- Copy the path to this new environment
- Install
python-dotenv
using ArcGIS Pro
-
Activate this environment in the terminal using the command:
conda activate "Path to the new environment"
Web App
As part of the Python module, a web app was created using streamlit, which uses the data generated by both the Floor and Building classes. It takes the geodatabase with the polygons for a given building. The app presented here uses a geopackage exported from that geodatabase.