Select to view content in your preferred language

How to select the group of features in feature class using geofence in geoevent service?

1006
1
03-23-2021 03:05 AM
dineshpatil
New Contributor

Hi @RJSunderman,

I am working on tower and lightning data. Also, there is a project boundary layer that contains multiple towers.

If lightning strikes in 3 miles buffer area of the tower then the status would be High Alert.

If lightning strikes in a 3 to 10 miles tower buffer area then the status would be moderate alert, and beyond 10 miles it is clear status.

I am updating the Towers alert status as High or Low respectively. After updating the Towers status, I've to update the project boundary alert status.

Scenario: Suppose, in project boundary - total 4 towers, and the alert status of 1 Tower is High and other 3 towers with moderate alert. So, the Project  Boundary alert would be High. (Means highest alert status should be assigned to project boundary layer).

Question is - Is there a way to select a number of towers together in the project boundary and get the highest alert status from the list of selected towers and update the Project Boundary alert status?

Thanks!

1 Reply
RJSunderman
Esri Regular Contributor

Hello Dinesh --

The first part of your question is relatively easy. If you were to poll a feature service to obtain a set of feature records whose associated geometry were a polygon modeling a "project boundary" you could route each event record through a GeoTagger processor to enrich the event record with the (unique identifier) names of point geofence imported from a feature service providing the point locations of towers. What you have now is a comma delimited list of towers that fall within a project boundary.

The difficulty is three-fold.

First, GeoEvent Server does not provide any sort of iterator to inspect individual items in a list. You don't know how many towers are expected to be in any given project boundary, so you cannot further enrich the "project boundary"  event record with the "alert status" for each tower ... because you cannot iterate across the list of towers to query their alert status.

You could use a Field Splitter processor from the GeoEvent Gallery to split a comma delimited list of towers in an enriched (geotagged) project boundary event record. This would produce separate event records, one for each tower in the project boundary. You could then enrich a second time to get the tower's alert status and add it to the project boundary event record. But each event record emitted from a Field Splitter is processed atomically (individually). This is the second challenge / limitation ... you cannot compare attributes from one event record with attributes in another event record.

The third challenge, as I see it, is there is no easy way to compare one tower's alert status to another and pick the greater of the two, especially when you don't know how many towers there are. I've never tried, for example, to design bitwise arithmetic into a GeoEvent Service to logically OR two bit sequences 0x0100 and 0x0010 to produce 0x0110 and then determine the highest-order bit set in the sequence. The logical operations GeoEvent Server supports are much more general (e.g. determining if an event record's string is empty or null to set a Boolean result to 'true' or 'false' and then comparing that 'true' / 'false' value against another Boolean to determine what to do with the singular event record being processed.

You might approach the problem using a GeoTagger as described above to get the name of point geofences in an area of interest, splitting the event record using a Field Splitter to produce several independent event records, and then use a Field Enricher to look-up the alert status for each event record's associated tower. You could then use an Update a Feature output to have GeoEvent Server make a REST request on a feature service to update the alert for an entire area (or project boundary) ... but you'll need some sort of database trigger to catch that request and only allow it to proceed if the alert value is equal-to or greater-than the feature record's current alert value. Otherwise, as I'm sure you realize, GeoEvent Server's serialized event processing stream will simply overwrite the project boundary feature record's alert status with the most recently processed tower's status.

Hope this information helps you think through the analysis you want to perform.

 

-- RJ

0 Kudos