Now that we have covered all of the components of geofencing, we can perform geofencing concepts in practice using our trajectory data. We will utilize the Plotly visualization library to animate trajectories and visualize our geofencing application. We will bring three polygons that denote different use cases: an airport, beach, and city center.
Geofencing with Plotly
Masking
First, we need to create a mask where we store whether a certain point is inside the geofence or not. We first read the geofence_polygons from the dataset provided with Notebook. Upload it first in Google Colab:
geofence_polygons = gpd.read_file('geofence_polygons.gpkg')
geofence_polygons
Geofence polygons
Let's plot and overlay geofence_polygons...