Zones
Zones model the physical spaces in your environment — buildings, floors, rooms, and outdoor areas — as a real-world coordinate hierarchy.
What is a zone?
A zone is a named region of physical space. Zones are hierarchical and self-referential: a building contains floors, a floor contains rooms, and a room can contain sub-zones — to any depth you need. Each zone optionally carries a boundary polygon in WGS-84 coordinates and altitude bounds for vertical disambiguation of indoor floors.
Zones integrate directly with assets. Every asset can be assigned to a zone by the user, and GPS-capable assets are automatically placed in the correct zone as their position updates.
Zone types
The zoneType field is a free-form hint — it tells the UI how to label and display a zone but has no effect on containment logic. The suggested values are:
| Type | Typical use |
|---|---|
building | Root zone for a physical structure. Contains floors or rooms directly. |
floor | A storey of a building. Use altitudeMin / altitudeMax to disambiguate vertically. |
room | An enclosed space within a floor. Carries a boundary polygon for GPS containment. |
outdoor | An outdoor area such as a yard, garden, or car park. Uses boundary only — no altitude range. |
region | A large geographic area — a campus, a neighbourhood, a city block. |
Boundary polygons and altitude ranges
A zone's boundary is a closed polygon expressed as an array of { lat, lng } points in WGS-84. You do not need to repeat the first point at the end — the platform closes the polygon automatically.
For indoor floor zones that share the same lat/lng footprint as the building above them, use altitudeMin and altitudeMax (metres above sea level) to distinguish them vertically. A GPS fix is considered inside the zone only if it falls within the polygon and, when altitude bounds are set, the asset's altitude is within that range.
Both fields are optional. A zone with no boundary is treated as unbounded — useful for building-level zones where you only care about containment at the room level.
GPS containment and asset location
When a GPS-capable asset publishes to the asset/location MQTT topic, the platform updates the asset's lat, lng, and altitude columns and re-evaluates zone containment. The result is written to asset.currentZoneId — the zone whose boundary currently contains the asset. If the asset moves outside all defined zones, currentZoneId becomes null.
This happens automatically with no plugin involvement. The containment check runs every time a location update arrives, so currentZoneId is always up-to-date.