Skip to content

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

Set-up Process

  1. Make sure all the prerequisites are installed and working.
  2. 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
  1. 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

  1. 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.

  1. Activate the environment in the terminal using the command:
.\venv\Scripts\activate

ArcGIS Pro

  1. 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
  2. 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.

Web App Demo