Overlapping geofences with different attributes

5334
4
03-26-2014 12:57 AM
EliasLazarou
New Contributor II
Hello everyone,

We have an issue working with geofences that we cannot still deal with. While tracking fishing vessels there is need to have a lot of geofence polygons that each one leads to a specific alert. For example there is a geofence that describes an area where the fishing is prohibited for "reason1". Also, the same time, there is another geofence polygon, overlapping with the first one, where the fishing is prohibited for "reason2". So the overlapping part contains criteria from both of them. How can we set up the incident detectors to generate two different alert points for the same vessel signal when it steps inside the overlapping part, so to warn us that it has violated both of them? Generating a new polygon of the overlapping area does not actually help us because the new polygon should reflect the criteria of both the polygons that comes from. So this again would not lead us to generate two different alerts.

Thank you in advance

Elias L.
4 Replies
RJSunderman
Esri Regular Contributor
Hello Elias -

In general, if you want to use a GeoTagger to identify a GeoFence a event's Geometry is within, and then use a Field Enricher to enrich the event with attribute information from the feature service used to create the GeoFences ... the individual GeoFences must not overlap. A description of why this is the case is presented in the thread Field" rel="nofollow" target="_blank">http://forums.arcgis.com/threads/104737-Field-Enricher-with-Mu... Enricher with Multiple Matches.

There is a work around, which you can scale depending on the number of potentially overlapping GeoFences. Please click to open the following illustration example" rel="nofollow" target="_blank">http://forums.arcgis.com/attachment.php?attachmentid=32575&d... GeoEvent Service, also attached below.

In the GeoEvent Service illustrated above I used a GeoTagger to add a field GeoFenceNames containing the names of each GeoFence the received event's Geometry is INSIDE as a List. Note that I did not use the default DelimitedValue. If the received event's Geometry is within an area overlapped by two GeoFences, the List appended to the event by the GeoTagger will have GeoFence names at the first two index positions:  GeoFenceNames[0] and GeoFenceNames[1]. (Note that the list's index is zero-based.)

By sending the geotagged event through a series of Field Calculator and Field Enricher processors, I can isolate the individual GeoFence names from the list and use those individual names as the key to the join needed to further enrich the events with attributes from a uniquely named polygon feature.

Each Field Calculator processor is able to handle the exceptional case in which there is no ordinal value at a specified index. For example, if the GeoFenceNames list contains only two identifiers, the expression GeoFenceNames[2] in the GetGeoFence3 processor will handle the exception by terminating event flow through that parallel branch. The other two branches will succeed in retrieving GeoFence names using the index values specified in their expressions, and the enrichment in-line with those two branches will succeed.

The Field Reducer in the illustration is optional. I'm using it to remove the Longitude and Latitude received with the original event and the GeoFenceNames List added by the GeoTagger ... to simplify the event and remove redundant data before it is sent to the output.

The TCP/Text output will receive one event for each named GeoFence in the GeoFenceNames List; the list tagged onto the event by the GeoTagger identifing all the GeoFences the original event's Geometry is within. The solution illustrated is not perfect -- it will only handle up to three overlapping GeoFences. But you can see, I think, how you could scale the workaround to handle a reasonable maximum number of instances of overlapping GeoFences. You will have to evaluate the performance of this workaround in your environment against the complexity of your polygon feature service geometries and schema as well as the rate at which you are feeding data into GeoEvent Processor.

Hope this information helps -
RJ
0 Kudos
EliasLazarou
New Contributor II
Thank you very much RJ. The workaround you described seems to work like a charm. It now lets me to go on designing the GeoEvent Service.

I'll open another post if i need anything else.

Thanks a lot. :cool:

Elias
0 Kudos
DanielVergara
New Contributor

Hi there,

Im getting the same trouble as you, any updates regarding this issue because I cant believe that the processor cannot process a list having in mind that the geotagger has the option of returning multiple geofences as a list and based on the solution presented here, you must decompose that array in various threads for getting the additional data of each of them.

Thanks in advance for your help

Daniel V.

0 Kudos
RJSunderman
Esri Regular Contributor

Hello Daniel -

My apologies that this reply is coming so long after you posted your question.

In case you are still facing a workflow in which a GeoTagger processor (out-of-the-box) is producing a list of GeoFences which satisfy the spatial criteria (e.g. GeoEvent Geometry INTERSECTS .*/.*) when GeoFence areas overlap, please take a look at the custom processor below which has been uploaded to the product gallery:

This custom processor is intended to be placed in-line with a GeoTagger, immediately following the GeoTagger, to split a single GeoEvent whose GeoTags attribute field contains a list of values into multiple events. This should eliminate the need to incorporate multiple Field Calculator processors in your GeoEvent Service to manually pull the names of GeoFences out of the list by hard-coded index.

Please let us know how this custom processor works for you.

Best Regards -

RJ