Public Space Occupancy – Overview
The Occupancy vertical provides real-time monitoring of visitor flows and capacity in public spaces using AI cameras and infrared counters.
What you can do with this module
- Live Monitoring: Track current occupancy and visitor flows in real-time.
- Capacity Management: Monitor occupancy percentages against defined capacity limits.
- Public Dashboards: Provide citizens with live occupancy information for parking lots, beaches, trails.
- Sensor Management: Configure and monitor AI cameras and infrared counters.
- Alert System: Receive alerts for capacity thresholds and sensor issues.
- Historical Analysis: Access historical data for planning and optimization.
Key concepts
Points of Interest (POIs)
Monitored locations like parking lots, viewpoints, trails, beaches, parks, or plazas. Each POI has: - Geographic boundary - Capacity limits (optional) - Associated sensors - Configured monitoring type
Sensors
Physical devices that capture visitor data: - AI Cameras: Computer vision-based detection with multiple "gates" (detection zones) - Infrared Counters: Simple entry/exit counting devices
Gates
Detection zones within sensors that track specific movements: - Entry gates: Count people/vehicles entering - Exit gates: Count people/vehicles leaving - Bidirectional gates: Track both directions - Flow gates: Monitor traffic flow (roads, walkways)
Sensor Readings
Raw data from sensors including: - Object type (person, car, bus, motorcycle, bicycle) - Direction (entry, exit) - Count per time interval - Gate and sensor identification
Occupancy Calculation
The system calculates occupancy based on POI configuration: - Entry/Exit tracking: Current occupancy = entries - exits (since midnight) - Flow monitoring: Traffic rate per hour - Trail estimation: Probabilistic occupancy using max trail duration
Monitoring types
| POI Type | Typical Monitoring | Calculation |
|---|---|---|
| Parking lot | Entry/Exit gates | Current vehicles = ins - outs |
| Beach | Entry/Exit gates | Current visitors = ins - outs |
| Trail | Entry + time-based | Estimated hikers using duration |
| Road | Flow gates | Vehicles per hour |
| Viewpoint | Presence detection | People currently in frame |
User roles
| Role | Responsibilities |
|---|---|
| Public Viewer | View live occupancy dashboards |
| Occupancy Operator | Monitor sensors, respond to alerts, manage POIs |
| Occupancy Administrator | Configure sensors, gates, thresholds, and alerts |
Where to start
- Viewing live data: Go to Occupancy → Public dashboards → View live occupancy
- Monitoring operations: Go to Occupancy → Operator workflow → Monitor sensors & alerts
- Managing locations: Go to Occupancy → Operator workflow → Manage points of interest
- Configuration: Go to Occupancy → Administrator setup
Behind the scenes (grounded in code)
- Models:
apps/occupancy/models.py(SensorEquipment, PointOfInterest, POISensor, GateMapping, SensorReading, OccupancyAlert) - Real-time updates: WebSocket consumers in
apps/occupancy/consumers.py - Data ingestion:
apps/occupancy/trino_client.py(lakehouse integration) - Background tasks:
apps/occupancy/tasks.py(data sync, alert checking) - Caching: Redis for occupancy calculations (5-minute TTL)
Integration with Equipment module
The Occupancy module has a soft dependency on the Equipment module: - Sensors can optionally be linked to Equipment records for full asset management - Works standalone if Equipment module is disabled - Integration enables maintenance tracking, warranty management, and cost allocation for sensors