Select to view content in your preferred language

ArcGIS Velocity Geofence or Snap to Network (to exclude vehciles from select locations)

957
3
12-15-2022 05:32 PM
MattGeorge1
Occasional Contributor

I’m looking for advice on setting up the best approach to create a Geofence in Velocity.  I have a real time analytic setup with two output layers.  I created a winter operations public facing snow plow map which is running in an ArcGIS solutions insta app frame.  Our County Public Works winter ops fleet is made up of 54 vehicle assets, and the two output layers in the real time analytic show vehicle observations.  One of the outputs keeps the latest observation displaying current location, it updates 2 minutes.  The other layer is very similar except it keeps all location observations and adds to the feature service to create a history of vehicle point locations along our primary snow routes.  I also have a new layer I want to use to isolate vehicle points in some specific locations.  The new layer is not in the real time analytic yet.  I’m trying to figure out how to setup a geofence with it but I don’t think it’s the traditional geofence workflow or maybe I’m misunderstanding the right approach to take in setting up a geofence for my purpose. The layer has 15 polygons which represent Pit Material locations and Road shop facility’s where the plows go to get salt and sand.  I want to exclude those locations from my output layers.

My workflow setup: I run both outputs as non-spatial temporal so that I can share publicly on our County home page.  We have the green light to share the web app out but I need to first figure out how to accomplish one more action item before it’s ready.  I need to hide vehicles when at pits and facilities.   In the web map / web app I run the current observation layer with a directional arrow icon using heading degrees to indicate the vehicle direction of travel.  I then copy the other output layer (3x) which shows all observations in the webmap and filter each copy by a different amount of time to create a layered effect showing points as breadcrumb trails for the Last Hour, Last 1-4 hours, and 4-12 hours ago.  It works really well and everyone seems to like it.  The first hour uses a much more contrasted symbol to pop it off the map and subsequent times layers use a faded color with some transparences.

The Points get real busy in the pits and road shop facility areas and we only want to display vehicle points publicly when they are on our primary snow plow routes. 

I’ve thought about using Snap to Network to clean up the points where our vehicles travel, but truthfully the points are actually clean and display nicely when they update.  I’m wondering which path to take to accomplish this; a Geofence of some sort or snap to network. I wonder if what I’m trying to accomplish is like a reverse geofence? if such a thing exists.  If I was to use the polygon feature service with pits and shop locations  where would that go in the Velocity real time analytic, before the map fields piece and after the feed, or after the mapping fields and before the output layers?  Or should I be thinking about snap to network more so than a geofence option?  I’ve read about Filter by Geometry and I’m learning about those geofencing parameters.  That would require to me add a join ID field to the polygon pits shop layer I assume if I need to also apply some logic with the Join time Windows, End time parameters piece etc. I never saw where I could simply throw that layer into the analytic and logically not display trucks when within those polygons. That seems like a long way around to accomplish not displaying the trucks at certain locations.  I think of Geofences as areas I want to capture something when a truck enters the area.  I want to exclude the oppositive in this situation.  Should I add a Join ID field to my Pits and Shop polygon layer so that I’m prepared to connect it somewhere in the real time analytic.  Does anyone have suggestion on which path I should take to accomplish this.  Here’s what the web app frame looks like showing the observations mentioned above.  Thanks for your help if anyone can give me some pointers.

Pic attachments show the app running on my iPhone from the Insta web app and one is from an OpsDash I made for internal use.  The second pic is a great example of truck traffic when at our facility coming in for Salt loads.  The map changes drastically throughout the day and night when things are happening.  Some of the time there are no points to display if enough hours have passed outside my time filters on the layers without any truck assignments.

Thanks, Matt George

 

 

IMG_0817.jpgIMG_0819.jpgIMG_0820.jpgIMG_0823.jpgIMG_0826.jpg

0 Kudos
3 Replies
PeterNasuti
Esri Contributor

@MattGeorge1 Thanks for posting your question to the Velocity community!

The key component I took away from your described scenario above is "The layer has 15 polygons which represent Pit Material locations and Road shop facility’s where the plows go to get salt and sand.  I want to exclude those locations from my output layers."

Pit Material locations and road shop facility polygons sound like relatively static locations to me, that are not added or removed or changed that frequently. Is that correct for your case? If so, this would be best added as a data source rather than a data feed. When configured as such, this polygon data would only be fetched when you restarted the real-time analytic (or when we updated the Velocity version, a few times a year).

If the goal is to simply remove any vehicle location points where they intersect with these polygons, I would utilize our Filter by Geometry tool with the Disjoint spatial operator. Disjoint is the inverse of intersects. This tool configuration could be added in any analytic pipeline where you want to keep the points that do not intersect a polygon.

Here is an image of this in action. The black dots are the original points simulating AVL. The light blue points are the features that are processed and pass the Filter by Geometry disjoint. 

Disjoint graphic.png

MattGeorge1
Occasional Contributor

Thank you @PeterNasuti  for taking time to read my workflow and make the suggestion to use the Disjoint operator with Filter by Geometry tool.  I’m going to def play around with this combo of things.  And yes you described the key component perfectly with the scenario I laid out.  Pit and shop facilities are static and see very little changes. 

Question, you mentioned this would be best added as a data source and become part of the real-time analytic upon restarting understood, but do you see any difficulty in keeping my current workflow setup as it is now with the avl feed pointing to the Map Fields tool where I have all the Arcade expressions written.  Or would I simply be adding the polygon feature service as an “additional” data source (my AVL feed is the source now).  If it’s an additional item I would connect it to the pipeline along with the Filter by Geometry tool using the Disjoint?  I ask, because I’m hoping I wouldn’t have to modify the Map Fields setup where I wrote all the arcade; That took a while to configure pulling all the data from the avl feed array to create 30+ expressions.

Perhaps I would need to add some fields to the Pits polygon layer so that I could join it somewhere in my pipeline workflow?  Or If I’m reading the parameters correct in Velocity documentation there’s no need to add fields to the pits poly layer, I would be making the selections in the Filter by Geom tool after connecting it with an arrow in the pipeline for input layer, join layer, “disjoint” for spatial relationship.  Doing this would allow me to not disturb the work I have into the real-time analytic already?

I attached two screen shots of what my pipeline workflow looks like and Map Fields tool with Arcade.  The Map Fields screen is small font to show how much Arcade was written to generate the attribute fields for over 30 fields in my output layers.  I want to make sure I’m adding the pit location polygon layer appropriately without causing too much rework with my existing Map Fields piece.

Thanks again for your input and help, I look forward to hearing what your thoughts are and I hope the real-time analytic screenshots help make sense of what I tried to describe.

Thanks again, Matt

0 Kudos
PeterNasuti
Esri Contributor

Hi @MattGeorge1 thanks for your reply and the info and screenshots.

If your Map Fields is working with the AVL data, there is no need for us to remove or modify that tool. Multiple tools can be configured across multiple pipelines. What I would propose is adding the Filter by Geometry tool to the model, and dragging the output of your Map Fields to the top (target) input of Filter by Geometry. Then, add your Pit Stops/Depots polygon layer as a data source, and connect that to the bottom (join) input of Filter by Geometry. This must be the same spatial reference as data from your feed. If needed, you can use the Project tool on the data coming in from the feed. Then, configure Filter by Geometry with the Disjoint operator, and any outputs connected to the Filter by Geometry tool will only contain features that do not intersect with your polygons.