Geofencing


Overview

Artists must set up the bounds of an exhibition space – AKA a geographically based fence (geofence). This is a geofencing protype I made powered by mapbox (which uses open street maps) and Firebase (for the database). The system can access the validity of a geofence client-side (fence’s can’t overlap!) and offer appropriate visual feedback. Some of the UI is created using procedurally generated meshes.

Tweaking

We require artists to physically walk around to plant the “poles” that make up the geofence - we want them to be active and present in the space they’re creating within. This presents a potential problem as GPS’s are never 100% accurate, and their accuracy can vary drastically from second to second, device to device, place to place… For these reasons, we provided a mechanism allowing users to manually tweak the position of poles after their initial placement, within a radius which is equal to the GPS inaccuracy at the time in which the initial pole was placed. This means if a GPS was accurate within 5 meters at the time of a pole placement, then the user gets a 2.5 meter radius in which they can move the pole around using their touch device.

Zooming

The map scale and position are calculated dynamically to encompass important features. The Unity Mapbox SDK does not come with fit-geobounds-within-camera functions built-in, and this ended up presenting some surprisingly difficult programmatic challenges. In some scenario’s with the geofence, the fence’s poles were too close together (less than 5m) for a global latitude-longitude coordinate based method to work with adequate precision. Instead, I had to use the view-based bounds of the fence from the map’s cameras POV before converting those results to a slippy-map zoom level that Mapbox could understand.

Leave a comment

Log in with itch.io to leave a comment.