Zone Detection Kit
Geofences with entry/exit events and dwell time.
0/5 complete
Zone Detection Steps
Load zone definitionsFetch polygon vertices from store300ms
Index spatial dataBuild R-tree for point-in-polygon800ms
Process entity streamCheck each entity against zones1500ms
Fire entry/exit eventsDetect zone boundary crossings600ms
Compute dwell timesTrack time spent in each zone400ms
Integration Code
import { createZoneDetector } from 'agent-tools-kit/spatial'
const detector = createZoneDetector({
type: 'polygon',
entryAlerts: true,
dwellTracking: true,
})
detector.defineZone('warehouse-A', {
type: 'polygon',
vertices: [[40.71,-74.00], [40.72,-74.00], [40.72,-73.99], [40.71,-73.99]],
})
detector.on('entry', (entity, zone) => {
console.log(`${entity.id} entered ${zone.id}`)
})