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.

geofencing examples in multiple shapes on a map of Chicago

An example of various shapes of geofences on a map of a Chicago neighborhood

Why Use Ignition Perspective?

There’s a multi-faceted reason to implement this project in Ignition Perspective.

  1. We are tying into the GPS signal on a mobile device, which difficult in Vision.

  2. We want to integrate Ignition into larger business systems outside of being the plant floor, and this is one way to get a lot of value out of Ignition without a lot of additional effort.

  3. 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 then we get to leverage the full power of Ignition by saving everything in a database. We can also set it up to automatically create database tables for you once you run the project, so it is simple to get it all up and running.

Check out our Perspective Geofence app on the Ignition Exchange.

Corso Systems Tech Talk: Geofencing with Ignition’s Perspective Module

What’s Next?

Now that our GeoFence app exists for Ignition Perspective, the sky is the limit! Some interesting things we have done with it include tying into Intelligent Transportation systems to implement bus scheduling and alerting by installing devices on a bus fleet with GPS signals that’s connected to a cloud-based Ignition server for real-time status and location monitoring of the fleet. We have also seen a similar system used for a life safety tracking system at a large factory. It can show real-time operator locations for safety tracking during fire drills and other large-scale evacuation events. On the less complex end of the spectrum, we’ve even used it in a facility for pulling up work order and data entry screens for maintenance staff when they get to a particular machine, saving them the time and hassle of looking up work orders in the system by displaying information in a “just-in-time” fashion.

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!

Previous
Previous

Integrating AGV Systems

Next
Next

Tailscale on Opto22 groov Hardware