Geofence on Ignition Perspective
At ICC 2019, Corso Systems released the first community content on the Ignition Exchange: Corso’s own William Bohn with his FactoryPacks, a library of objects. And, it remains as one of the most downloaded items on the Exchange!
An interesting bit of information that came from this release was that Travis Cox had to go back to Inductive Automation’s offices to work on the Ignition Exchange a couple days before the release, because access to the server was geofenced to their office! The way it was set up, he couldn’t access it remotely—not even via VPN.
Geofencing Technology
As a concept, Geofencing has existed in day to day life at least as recently as when smartphones began to permeate everyone’s pockets. Before then, it would have been possible with standard GPS hardware, but geofencing really took off when smartphones became connected to both GPS and the internet.
Geofencing at it’s core allows you to set up a geometric shape on a map, known as a “geofence” and determine if someone is inside or outside that shape based on their GPS coordinates, or latitude and longitude. These shapes can be as simple as a circle centered at a given point with a radius of X number of feet, or as complex as tracing the outline of a building or a plot of land. Once the geofences are created, they can be checked against a user’s GPS coordinates and we can determine if they are inside the shape, outside the shape, how far away they are, etc.
How Can You Use Geofencing Information?
Once you know if a user is inside the geofence (or not), you can use that information in many ways. You can enable/disable access to computers, manufacturing equipment, etc. You can implement security, giving read-only access to people outside a factory. If you have an alert or notification system for particular facilities, you can trigger alerts for the nearest facility to be sent to that user’s phone. If you have used apps like Foursquare, or allowed Google Maps or any other smartphone app to use your location, you may have noticed targeted ads show up based on your location. Even social media tools and features like geofenced Snapchat filters can be tied into a geofencing system!
You could even get really creative and use geofencing for an autonomous vehicle system. For example, you could ensure that a vehicle like a boat stays clear of known land hazards, or a car could avoid buildings. Integrated with an automated guided vehicle system (AGV), geofencing can be used to alert your operators when the AGV is in a pick-up or drop-off location.
How Geofencing Works
There are a number of excellent walkthroughs of the math involved with geofencing. A you search for “Geofence algorithm” will return a lot of excellent information—one great example is a guide from Baeldung. Basically for complex shapes like polygons, you check each coordinate of the lines that make up the perimeter of the polygon against the point—if the point is within the space of the line, then you mark it as inside. Repeat this process around the polygon until you have tested the entire perimeter. If after going through the entire perimeter you are marked as inside, you set a variable to true. If you are outside the polygon, you set the variable to false. You will also know whether a user (with their device giving the GPS signal at a particular latitude/longitude) is in the polygon.
For circular geofences, you only need to check if the user is within the radius of the circle based on their location from the center point.
In the screenshot below you will see a circular geofence, along with a few simple rectangular shapes, and a slightly more complex shape around a building.
Why Use Ignition Perspective?
There’s a multi-faceted reason to implement this project in Ignition Perspective.
We are using the GPS signal on a mobile device, which difficult in Vision.
We want to integrate Ignition into larger business systems beyond the plant floor, and this is one way Ignition brings a lot of value without much additional effort.
Finally, we believe in the overall idea of the Ignition Exchange as a melting pot of ideas, technology, and collaboration. So, we want to build interesting things to release there!
Perspective also makes it really easy to interact with the map. Drawing complex polygons is trivial, adding circles is even easier—and we can leverage the full power of Ignition by saving all of this information in a database. We can also set up Ignition to automatically create database tables once you run the project—so it is simple to get everything setup and running.
Check out our Perspective Geofence app on the Ignition Exchange.
What’s Next With GeoFencing?
Now that our GeoFence app exists for Ignition Perspective, the sky is the limit! Some interesting use cases we’ve implemented with it include integrating with Intelligent Transportation systems for bus scheduling and alerting by installing devices on a bus fleet with GPS signals—and connected to a cloud-based Ignition server for location monitoring and real-time status of the fleet.
Similar systems can also be life safety tracking systems at a large factory. It can show operator locations in real-time for safety tracking during fire drills and other large-scale evacuation events. On the less complex end of the spectrum, we’ve even used GeoFencing to automatically load work order and data entry screens for maintenance staff when they get to a particular machine, saving them the time and hassle of manually looking up work orders in the system.
You could even build out a fill shipping and logistics application in Perspective, automatically generating Geofences using rules and an app like geocodio to automatically generate fences for shipments as they leave the warehouse.
Thanks for reading to the end, and if you would like more information on Geofencing for your facility, or have any questions on anything you have seen here please drop us a line!
Do You Need Geofencing at Your Facility?
(Or just have more questions about how it could work for you)
Schedule an intro call with Cody Johnson in sales
Or Contact Us with your project details and requirements