Sei sulla pagina 1di 29

NOTE: The ArcGIS GeoEvent Processor team updates the product tutorials frequently to reflect the latest version

of the software. Depending on


the product version you are using, there may be inconsistencies between your environment and illustrations or specific steps in the exercises. The
concepts outlined in the exercises, however, should be applicable across product versions.

Introduction to GeoEvent Processor Module 3

GEP 10.2.x / Rev B

Introduction to ArcGIS GeoEvent Processor Module 3


Introduction & Module 3 Overview .............................................................................................................. 3
Objectives for Module 3 ........................................................................................................................... 3
Getting started .......................................................................................................................................... 3
Working with Filters ...................................................................................................................................... 4
Filter based on attribute conditions ......................................................................................................... 5
Filtering event streams containing multiple event types ....................................................................... 10
Filtering based on tagged fields .............................................................................................................. 16
Filtering based on spatial conditions ...................................................................................................... 18
Update your Flights GeoEvent Service................................................................................................ 20
Update your Flights web map (optional) ............................................................................................ 21
Simulate flight events to observe spatial filtering .................................................................................. 24
Synchronizing GeoFences with dynamic feature layers ......................................................................... 26
Congratulations! ......................................................................................................................................... 29

Introduction to GeoEvent Processor Module 3

March 2014

Page 2 of 29

Introduction & Module 3 Overview


The Introduction to GeoEvent Processor tutorial the first in a series of tutorials developed to introduce
the many different capabilities of ArcGIS GeoEvent Processor for Server has been divided into five
separate modules. The scope and material covered in each module is described in Module 1.
The modules in this tutorial were designed to complement one another by presenting different functional
areas of the product and exploring the functionality through exercises. While exercises in later modules do
not generally require you to complete the exercises from the previous modules, you are encouraged to
work through the Introduction to GeoEvent Processor tutorial beginning with Module 1 and continuing
through Module 5. This is especially true for exercises in Module 5 in which readers can expect the
narrative and illustrations in an exercise to replace some of the step-by-step instruction presented in
earlier modules.
At the start of each module, and occasionally within a module, a GeoEvent Processor configuration will be
referenced which can be imported to update and/or create configurable items such as inputs, outputs,
GeoEvent Definitions, and/or GeoEvent Services. Carefully review the notes which identify what the
GeoEvent Processor configuration contains, as it may update or reset items you created and modified as
part of a previous exercise or product exploration you have completed on your own.
Module 3 introduces the concept of event filtering. Exercises in this module will illustrate how service
designers incorporate attribute-based and spatial filters into GeoEvent Services. You will have an
opportunity to examine how GeoEvent Definitions and GeoEvent field tags can be incorporated into filters
as well as how filter expressions can be logically combined to form more complex filters.

Objectives for Module 3


Once you have completed the exercises in this tutorial you should be able to:

Explain the role attributes play in events and GeoEvent Definitions.

Use the GeoEvent Simulator to simulate different types of event streams.

Demonstrate the use of basic attribute-based event filters in GeoEvent Services.

Import and work with GeoFences to filter events based on spatial constraints.

Work with GeoEvent Processor Manager to define and configure filter properties.

Getting started
If you are starting with this module, a GeoEvent Processor configuration file is included to help you
quickly get started with the exercises in this module. Importing this product configuration will create the
items listed below if items with the same names already exist, importing the product configuration will
update them and overwrite any changes you may have made in a previous module.

Introduction to GeoEvent Processor Module 3

March 2014

Page 3 of 29

Module 3 GeoEvent Processor Quick Start Configuration contents:

A tcp-text-in input and a tcp-text-out output.

A Flights GeoEvent Service which incorporates the input and output.

A Flights-TcpTextIn GeoEvent Definition used to interpret simulated flight event data.

A registered instance of ArcGIS for Server named LOCALHOST_AGS.

If you completed Module 2, you will notice the Flights GeoEvent Service in this configuration file has
been simplified to remove field mapping and the feature service output which are not necessary for the
exercises in this module. The server data store assumes ArcGIS for Server is installed on the localhost
and is reachable at http://localhost:6080/arcgis/.
Follow the steps below to import the GeoEvent Processor configuration for Module 3.
1. Open GeoEvent Processor Manager at https://localhost:6143/geoevent/manager/.
2. In GeoEvent Processor Manager, navigate to Site > GeoEvent Processor > Configuration Store.
3. Click Import Configuration and browse to Module3_QuickStart.xml file located in the
\configurations folder included with this tutorial.
4. Select the Module3_QuickStart.xml file and click Import to import the configuration.
Notice the tcp-text-in Input Connector and tcp-text-out output are in a STOPPED state. You may find that
stopping your input, output, and GeoEvent Service components before exporting a GeoEvent Processor
configuration is a good practice. Upon import, a STARTED component has the potential to begin
processing data immediately and could possibly conflict with other started components. You can start
and stop components in GeoEvent Processor Manager.
5. Navigate to Services > Inputs and click
6. Navigate to Services > Outputs and click

to start the tcp-text-in input.


to start the tcp-text-out output.

The Flights GeoEvent Service should already be running. There is little a GeoEvent Service can do if its
inputs and outputs are not running.

Working with Filters


The exercises in this module have been designed around event filtering. The ability to efficiently identify
events of particular interest based on event attribution, proximity, or some combination of attribute and
spatial factors is important to analysts. Filters allow analysts to control the flow of event data through a
GeoEvent Service and be more selective in which events are sent to an output. In the exercises below
you will explore how expressions are created and logically combined, how filters are created, and how
to incorporate filters into GeoEvent Services.

Introduction to GeoEvent Processor Module 3

March 2014

Page 4 of 29

Filter based on attribute conditions


In this exercise you will update the Flights GeoEvent Service. This service incorporates a one input (tcptext-in) and one output (tcp-text-out). You may recall working with this GeoEvent Service in Module 2.
If you imported the GeoEvent Processor configuration above, you will notice the Flights GeoEvent Service
has been simplified to match the illustrations below, removing service elements not necessary in this
module.

Follow the steps below to create and configure a new attribute filter, incorporate the filter into the
Flights GeoEvent Service, publish the reconfigured service, use the GeoEvent Simulator to simulate flight
events, and observe the simulated event data output in a TCP Console application.
7. In GeoEvent Processor Manager, navigate to Services > GeoEvent Services and click the Flights
GeoEvent Service to edit it.
8. Click Show to reveal the menu containing the alignment tools and service components available.
9. Double-click Filter in the menu to add a new filter element. The Filter Properties dialog will open
where you can configure the new filter element.

Introduction to GeoEvent Processor Module 3

March 2014

Page 5 of 29

10. Enter Low Altitude as the name of the new filter element.
11. Click the Definition drop-down and select the Flights-TcpTextIn GeoEvent Definition.
Note: The list only contains GeoEvent Definitions currently configured as part of your site.
12. Click the Field drop-down and select the Altitude event field.
Note: The list only contains event fields applicable to the selected GeoEvent Definition.
13. Click the Operator drop-down and select the >= operator.
Note: The list only contains operators applicable to the data type of the selected field.
14. Enter 10000 in the Value property text box.

The properties illustrated above configure a single filter expression. A filter must contain at least one
expression. Multiple expressions can be logically combined within a single filter as you will see shortly.
15. Click

to add the expression to the filters list of criteria.

When using the Filter Properties dialog to configure filters:

To edit an expression, click the expression once to select it the properties will be available and
you can edit the expression as necessary.

Introduction to GeoEvent Processor Module 3

March 2014

Page 6 of 29

To delete an expression, click


be listed.

Notice the
drop down to the left of the expressions list. When adding multiple
expressions to a filter, you can specify whether each condition needs to be true in order for the
event to pass through the filter (e.g. AND) or whether it is sufficient that any condition be true in
order for the event to pass through the filter (e.g. OR).

next to the expression the deleted expression will no longer

16. Click Ok to create the new filter.


17. Connect the Low Altitude filter in the GeoEvent Service as illustrated below.

18. Click Publish to publish the reconfigured Flights GeoEvent Service.


Note: To quickly view the properties of the
new filter, click it once to display its
properties in a popup window.
Double-clicking the filter will open the
properties dialog for editing.

19. Launch the TCP Console application which will be used to monitor data sent to a TCP socket from
GeoEvent Processor.

20. Open the GeoEvent Simulator and configure the properties below:

Click Load File and browse to the FeatureFlights.csv file in the \simulations folder included
with this tutorial.

Leave the Time Field # property set to field 1 and click Load.

Check the Set value to Current Time checkbox to simulate real-time data.

Introduction to GeoEvent Processor Module 3

March 2014

Page 7 of 29

Uncheck the Continuous Loop checkbox.

Set the rate to send 9 messages every 1000 milliseconds.

Click Click to Connect to establish your server connection.

Refer to the illustration below and the exercise steps in Module 1 for more information on configuring
the GeoEvent Simulator.

21. Click Step

once to send a flight event.

In the TCP Console application, you should see a number of new flight events appear.

Notice that only 7, of the possible 9, flight events were sent from GeoEvent Processor. The two events
that were not sent were filtered by the filter you incorporated above that filters out any flights below
the established altitude of 10,000. Filters in GeoEvent Services are exclusive; events which do not meet
the filters criteria are removed from the event stream and are not sent to a designated output.
22. In GeoEvent Processor Manager, navigate to Services > Monitor.
Notice the Flights GeoEvent Service shows an event count of 9 events In and 7 events Out.

Introduction to GeoEvent Processor Module 3

March 2014

Page 8 of 29

The event counts beneath Inputs and Outputs confirm that nine events were received by the input, but
only seven events were sent to the output.
Note: You may need to click Reset Statistics and send another batch of nine events from the GeoEvent
Simulator to see this illustrated, especially if you have been using GeoEvent Processor prior to
starting this exercise.
If you open the FeatureFlights.csv file in a text editor, you should be able to identify the two events
whose altitude was less-than 10,000 resulting in the events being filtered or removed from the event
stream by the Low Altitude filter in the Flights GeoEvent Service.

Review the simulation data and confirm that only 61 of the 81 flight events report an altitude greater-orequal to 10,000.
23. In GeoEvent Simulator, click Play
Processor.

to send the remainder of the flight events to GeoEvent

24. In the TCP Console application, you should observe the 61 events that met the filters criteria.
25. In GeoEvent Processor Manager, navigate to Services > Monitor.

Introduction to GeoEvent Processor Module 3

March 2014

Page 9 of 29

Notice the event counts confirm that 81 events were received by the input, but only 61 events were
sent to the output.

Filtering event streams containing multiple event types


Recall when you configured the Low Altitude filter, you were able to specify the GeoEvent Definition and
field on which filtering should take place.

Some of the following questions may have occurred to you:

What if the wrong GeoEvent Definition had been selected and the filters criteria specified a
field not included in the event (e.g. AltitudeInFeet >= 10000 rather than Altitude >= 10000)?

What if the event were being interpreted with a different GeoEvent Definition such as one
which named the event field AGL or AboveGroundLevel rather than simply Altitude?

Again, filters in a GeoEvent Service are exclusive. If an event is received which does not have the filters
target field, the event will be discarded. If an event is received which has the target field, but the field value
does not meet the filters criteria, the event will be discarded. If the attributes data type does not make
sense given the filters expression (e.g. Altitude >= SomeStringValue) the behavior is undefined; events may
or may not be filtered depending on the systems ability to convert SomeStringValue to an Integer.
The different drop downs available on the Filter Properties dialog are designed to help you quickly
construct valid queries. When you choose a GeoEvent Definition, only the fields available in that
GeoEvent Definition are displayed in the Fields drop-down. Further information is provided including the
field names, data types, and field tags which can help you in determining appropriate operators and
values.
You may have noticed the Definition drop-down contains an asterisk (*) as an available option, as
illustrated below.

Introduction to GeoEvent Processor Module 3

March 2014

Page 10 of 29

A filter applies its criteria to any event received by the filter. If you wanted a filter to apply its criteria to
only one type of event, you would select the $DEFINITION_NAME as the Field and build an expression
like: $DEFINITION_NAME = Flights-TcpTextIn. You would then add the expression to the filters list of
criteria, combining the expression with a logical AND as illustrated below.

Notice, by selecting $DEFINITION_NAME, the Value property changes to a Definition Name property
with an available drop down which lists only the GeoEvent Definitions currently configured as part of
your site.
The following exercise was designed to illustrate the two concepts highlighted above the exclusive
nature of filters and the ability to filter based on GeoEvent Definitions. Follow the steps below to import
a GeoEvent Processor configuration that contains the GeoEvent Service, inputs, outputs and GeoEvent
Definitions which support the following exercise.
1. In GeoEvent Processor Manager, navigate to Site > GeoEvent Processor > Configuration Store.
2. Click Import Configuration and browse to the Module3_AVL_Exercise.xml in the
\configurations folder provided with this tutorial.
This GeoEvent Processor configuration contains the following items:

Two new GeoEvent Definitions (AVL-Model-26T and AVL-Model-9A) used to interpret simulated
Automatic Vehicle Location (AVL) event data.

An AvlReports-TcpTextIn input and an AvlReports-TcpTextOut output.

An AVL_Reports GeoEvent Service which incorporates the input and output.

3. Click Import to import the configuration.


The new input and output are configured to use the same port as the tcp-text-in input and tcp-text-out
output used in other exercises. Remember, no two components can connect to the same port at the
same time, so the new input and output were imported in a STOPPED state.
4. In GeoEvent Processor Manager, navigate to Services > Inputs.
5. Click

to the right of the tcp-text-in input to stop the input.

Introduction to GeoEvent Processor Module 3

March 2014

Page 11 of 29

6. Click

to the right of the imported AVLReports-TcpTextIn input to start the new input.

7. Navigate to Services > Outputs. Use the available controls to stop the tcp-text-out
output and start the new AvlReports-TcpTextOut output.
8. Navigate to Site > GeoEvent Processor > GeoEvent Definitions.
Notice the two new GeoEvent Definitions added to the list. These two GeoEvent Definitions are nearly
identical, the only difference being AVL-Model-9A provides the vehicles current mileage, whereas AVLModel-26T does not.

9. In Windows Explorer, browse to the AVLSample.csv simulation file located in the \simulations
folder provided with this tutorial.
10. Open the AVLSample.csv file in a text editor to review its contents.

The scenario suppose you had a data feed that sent event data from vehicles equipped with different
models of an AVL module and you wanted to use a filter to identify which vehicles had exceeded 30,000
miles and use that as an indicator that scheduled maintenance is necessary.
Based on the above information, you know that applying a filter with an expression like Mileage > 30000
is going to filter out all of the events reported by the AVL Model 26T, because that model does not have
a Mileage field so it is not reporting vehicle mileage. In this scenario, you do not want to lose those
events from that particular model, so you will make a few updates to your GeoEvent Service so you can
preserve those events.
11. In GeoEvent Processor Manager, navigate to Services > GeoEvent Services.
12. Click

to edit the AVL_Reports GeoEvent Service.

13. Click to select the Model-9A (Mileage) filter to review the filters properties.

Introduction to GeoEvent Processor Module 3

March 2014

Page 12 of 29

14. Click Show to reveal the menu containing the alignment tools and service components.
15. Double-click the Filter element to add a new filter to the canvas.
16. In the Filter Properties dialog, define a new filter expression as illustrated below.

17. Click

to add the expression to the filters list of criteria.

18. Click Ok to create the new filter.


19. Incorporate the new Model-26T filter into the GeoEvent Service as illustrated below.

20. Click Publish to publish your reconfigured GeoEvent Service.


21. Open the GeoEvent Simulator and configure the properties below:

Click Load File and browse to the AVLSample.csv simulation file in the \simulations folder
provided with this tutorial.

Change the Time Field # property to 2 and click Load.

Check the Set value to Current Time checkbox to simulate real-time data.

Uncheck the Continuous Loop checkbox.

Introduction to GeoEvent Processor Module 3

March 2014

Page 13 of 29

Set the rate to send 3 messages every 1000 ms.

Click Click to Connect to establish your server connection.

Refer to the illustration below and the exercise steps in Module 1 for more information on configuring
the GeoEvent Simulator.

22. Click Play to send the 21 events in the AVLSample simulation file.
In the TCP Console application, notice that 16 of the 21 events are sent from GeoEvent Processor. All of
the AVL-Model-26T events were sent, but only the AVL-Model-9A events whose Mileage value was
greater-than-or-equal to 30,000 were sent, as illustrated below.

In GeoEvent Processor Manager, the Monitor page helps you quickly see which components are running
(e.g. STARTED), which are stopped, as well as the number of minutes since the last event was received.
The input and output associated with the Flights GeoEvent Service should not have received any events
for several minutes, while the components used in this exercise has received event very recently.

Introduction to GeoEvent Processor Module 3

March 2014

Page 14 of 29

When a GeoEvent Service is designed to send event data to two different filters as you did in this
exercise it is important to note that all events are actually sent to both filters, Model-26T and Model9A (Mileage), but only the events that meet the filters criteria are sent to the one output.

Depending on the complexity of your filtering logic, you might elect to combine separate filters (like the
above) into a single filter containing multiple expressions. The illustration below shows how you could
combine the expression from each filter above into a single filter using the logical OR with the objective
of simplifying the GeoEvent Service.

Introduction to GeoEvent Processor Module 3

March 2014

Page 15 of 29

Filtering based on tagged fields


You will recall from the Making Features Come Alive exercise in Module 2 that a field tag is a label
applied to a field in a GeoEvent Definition. Tags allow GeoEvent Processor to identify an event field and
substitute the field name with the tag. They also apply to certain GeoEvent Service components, in
which fields are used to uniquely identify events belonging to a particular entity such as when you
tagged the FlightNumber field with a TRACK_ID tag which supported the output used to update a
feature service.
This section does not contain any exercise steps, it does discuss how you work with tags in GeoEvent
Definitions and illustrates (via screenshots) how filters can be configured to work with tagged fields.
Suppose you had a number of vehicles in a fleet and different vehicles were configured with different
models of transponders that were providing real-time data feeds. Unlike the previous example in which
the events were essentially the same (one simply included an additional field), suppose the schema of
the events being reported by the different transponders was significantly different.
Considering one attribute in particular a vehicles current speed you discover that events for one type
of vehicle reports this value as Speed, while another type of vehicle reports the exact same information
as Rate. Other types of vehicles might report the vehicles speed as Acceleration or simply VehicleSpeed.
GeoEvent Processor includes processors that enable field mapping and field reduction (discussed in
more detail in Module 4 and Module 5). One way to address the issue of equivalent information being
reported by events using different field names is to create and use tags to identify the equivalent fields.
Tags can be created in GeoEvent Processor Manager. The four tags shown in the illustration below are
the default tags, new tags can be created to support your specific requirements.

When creating a new tag, you would enter the name for of the new tag, a general description, and
define the data type. The data type is important, as the tag can only be applied to fields within a
GeoEvent Definition which match the tags type.

Introduction to GeoEvent Processor Module 3

March 2014

Page 16 of 29

For example, you could create a SPEED tag that would be applicable to fields which include any type of
integer value (short or long).

Once you have a custom tag, you can apply the tag to fields in different GeoEvent Definitions.

Filters can be configured with expressions that use tags rather than specific event field names. For
example, you could configure a filter which discards all events whose field tagged with SPEED was less
than some specified value.
In the illustration below, if an event were received by the filter whose GeoEvent Definition did not have
a field tagged SPEED, that event would be discarded by the filter.

Introduction to GeoEvent Processor Module 3

March 2014

Page 17 of 29

Filtering based on spatial conditions


This section demonstrates how to filter events using spatial conditions. To use a filter to evaluate spatial
conditions, you must have GeoFences to which the filters expression can refer. You must therefore
import and configure a set of GeoFences using GeoEvent Processor Manager prior to defining a filter
with a spatial condition.
NOTE: The Storms.mpk map package must be published as a feature service to complete this exercise.
The map packages are provided in the \data folder included with this tutorial. The Publish a
feature service to ArcGIS Server exercise in Module 2 details the steps to publish a feature service.
1. In GeoEvent Processor Manager, navigate to Site > GeoEvent Processor > GeoFences.
2. Click Import GeoFences.
3. On the Import GeoFences dialog complete the properties as illustrated below.
NOTE: The properties displayed may differ depending on your specific environment.

Introduction to GeoEvent Processor Module 3

March 2014

Page 18 of 29

When using the Import GeoFences dialog to import polygon geometry from a feature service:

The Name property functions much like a TRACK_ID. Each storm in the feature layer being
imported should have a unique name, this allows GeoEvent Processor to update its GeoFences
if/when the features in the feature layer are updated.

The WKID is the Well-Known ID of the WGS 1984 geographic coordinate system. For best
performance, you should choose the WKID of the spatial reference in which the event data is
expressed. All of the data provided with this tutorial uses latitude/longitude, which is why 4326
is the chosen WKID.

You can improve GeoEvent Processor performance by simplifying the GeoFences when they are
imported. The Max Allowable Offset property specifies the maximum physical distance the
simplified polygon can deviate from the original one. Larger values create more generalized
GeoFences and will result in faster spatial comparisons, but they will be less accurate.

4. Click Import to import the Storms features as GeoFences.


Notice a new StormHazards category was created. It contains a single GeoFence which corresponds to
the shaded area you observed when the feature layer was added to your web map previously. The
GeoFences name was taken from the Names field in the feature layer.

Introduction to GeoEvent Processor Module 3

March 2014

Page 19 of 29

Update your Flights GeoEvent Service


In the second part of this exercise, you will incorporate a spatial filter into the Flights GeoEvent Service.
The spatial filter will be used to discard flight events whose location is not inside a GeoFence from the
StormHazards category. So, only flights located within a storm will be sent to the TCP Console
application.
5. In GeoEvent Processor Manager, navigate to Services > GeoEvent Services.
6. Click the Flights GeoEvent Service to edit the service.
7. Click Show to reveal the menu, then drag and drop a new Filter onto the canvas and configure as
illustrated below.

Note: When choosing the Field, you can choose either GEOMETRY beneath the TAGS category (as shown
above) or shape beneath the FIELDS cateogry. This is another instance in which having the appropriate field
tagged in your GeoEvent Definition can make it easier to quickly configure elements in a GeoEvent Service.
8. Click

to add the expression to the filters list of criteria.

9. Click Ok create the filter.


10. Connect the filter in the GeoEvent Service as illustrated below.

Note: Delete any elements you do not need


such as the filter used to filter events based
on a flights altitude.
11. Click Publish to publish the reconfigured GeoEvent Service.
In the illustrations above the wildcard (.*) immediately after the GeoFence category StormHazards
specifies that any storm in the category StormHazards should be considered when evaluating the filter
expression. Currently, there is only one storm, however you could add additional GeoFences to the
category to simulate additional storms. This will be discussed more in a later exercise.
If you completed the exercises in the Filtering event streams containing multiple event types section
above, you will need to stop the input and output used by the AVL_Reports GeoEvent Service and start
those used by Flights. This is necessary because the components in these exercises have been

Introduction to GeoEvent Processor Module 3

March 2014

Page 20 of 29

configured to use the same TCP port and two components cannot utilize the same port at the same
time.
12. In GeoEvent Processor Manager, navigate to Services > Inputs.
13. Click

to stop the AVLReports-TcpTextIn input.

14. Click

to start the tcp-text-in input.

15. Navigate to Services > Outputs and stop the AvlReports-TcpTextOut output and start the tcp-textout output.
Recall that the Monitor page helps you quickly see which service components are running, which have
been stopped, and the number of minutes since the last event was received by a particular component.
16. In GeoEvent Processor Manager, navigate to Services > Monitor.
17. Click Reset Statistics to clear the event counts for each component.
Notice in the illustration below the AVL related inputs and output have been stopped and the tcp-text-in
input and tcp-text-out output that are part of the Flights GeoEvent Service have been started.

Update your Flights web map (optional)


The exercise steps 18 27 below are optional. You have already reconfigured and published the Flights
GeoEvent Service to filter GeoEvents based on their location, whether they are INSIDE or OUTSIDE a
storm GeoFence. If you want to see your flight locations update on a web map, in addition to sending

Introduction to GeoEvent Processor Module 3

March 2014

Page 21 of 29

them to the TCP Console application, you will need to update the web map you worked with as part of
the Making Features Come Alive exercise in Module 2.
If you do not have the Flights web map or the Update a Feature output, take some time to work through
the Making Features Come Alive exercise in Module 2 before proceeding with the steps below.
18. Sign in to your ArcGIS Online account and click MY CONTENT.
19. Click the Flights web map to access the item details.
20. Click OPEN and choose Open in ArcGIS.com map viewer.
21. Click Add and choose Add Layer from Web and enter the URL of your published Storms feature
layer.
Obtain the feature service URL from the ArcGIS REST Services Directory:

Browse to http://localhost:6080/arcgis/rest/services and select the feature layer


IntroToGEP > IntroToGEP/Storms (FeatureServer) > Storms.

Copy the browsers URL and paste it in the URL property on the Add Layer from Web dialog (e.g.
http://localhost:6080/arcgis/rest/services/IntroToGEP/Storms/FeatureServer/0).

Compare your web map against the illustration below. Notice the Storms layer is beneath the Flights
layer in the Contents view.
Note: The locations of individual flights may differ depending on what point you stopped simulating
flight events.

Introduction to GeoEvent Processor Module 3

March 2014

Page 22 of 29

For this exercise, you will configure the web map to refresh the layer content periodically. The web
map will not update as frequently as it could if you used the Operations Dashboard for ArcGIS, since
the minimum refresh interval for a web map is 0.1 minutes (or every 6 seconds), but for these
purposes this will be sufficient and it demonstrates another way you can visualize data.
22. Click

to the right of the Flights layer.

23. Choose Refresh Interval and set the layer to refresh every 0.1 minutes as illustrated below.

24. Click Save to save the Flights web map.


Next, you will update the Flights GeoEvent Service to make sure it is sending event data to an output
that is updating the features displayed in the web maps feature layer.
25. In GeoEvent Processor Manager, navigate to Services > GeoEvent Services.
26. Click the Flights GeoEvent Service to edit the service.
27. From the menu, add the fs-out output you created in Module 2 to the canvas and configure the
service as illustrated below.

The steps above were optional and not required in order to proceed to the next section below. You only
needed to complete the Making Flights Come Alive section found in Module 2 if you want to add an

Introduction to GeoEvent Processor Module 3

March 2014

Page 23 of 29

output that updates a web maps feature layer to display the location of a flight regardless of whether or
not it is INSIDE a storm boundary.

Simulate flight events to observe spatial filtering


In the steps below you will use the GeoEvent Simulator to simulate flight events and observe the spatial
filter in action.
Throughout the steps below, you will find references to a configuration in which unfiltered event data is
being sent to an output which updates a Flights feature service. If you chose to start with Module 3,
focus on the illustrations of the TCP Console as you work through this exercise the events displayed in
the TCP Console are the events which have been allowed through the filter named Inside Storm.
1. Open the GeoEvent Simulator and configure as follows:

Click Load File and browse to the FeatureFlights.csv file in the \simulations folder included
with this tutorial.

Leave the Time Field # property set to field 1 and click Load.

Check the Set value to Current Time checkbox to simulate real-time data.

Uncheck the Continuous Loop checkbox.

Set the rate to send 9 messages every 1000 ms.

Click Click to Connect to establish your server connection.

Refer to the illustration below and the exercises in Module 1 for more information on configuring the
GeoEvent Simulator.

In the illustration above, notice the count of events Sent is 0 and the slider has been reset to the
beginning of the simulation file such that SWA2706 will be the first flight event sent.

Introduction to GeoEvent Processor Module 3

March 2014

Page 24 of 29

2. In GeoEvent Processor Manager, navigate to Services > Monitor.


3. Open the TCP Console application used to monitor data sent to a TCP socket from GeoEvent
Processor.
4. In GeoEvent Simulator, click Step

once to simulate a batch of 9 flight events.

From the Monitor page, the tcp-text-in input should have received 9 events In. The event count for the
tcp-text-out output should not have registered any events. In the TCP Console application, you should
not have received any flight events because, in the first batch of flight events, there are no flight events
INSIDE the Rocky Mountain storm.
Notice the event count for the Flights GeoEvent Service will only register events Out if at least one
output participating in the GeoEvent Service has sent event(s). If you elected not to incorporate the
fs-out output in the Update your Flights web map (optional) section above, all nine events in this first
batch would be filtered by the filter named Inside Storm no events would be delivered to the
tcp-text-out output, so the GeoEvent Service event count would remain at 0.
5. In the GeoEvent Simulator, click Step

three (3) times slowly to send an additional 27 events.

If you are watching your Flights web map, give the map at least six (6) seconds to refresh and display the
event data. Notice the green dot, representing Flight SWA1586, is approaching the identified storm
area. The TCP Console application should not have received any flight data yet because no flights have
been reported INSIDE the storm area.

6. Click Step

once more to simulate an additional 9 events.

Introduction to GeoEvent Processor Module 3

March 2014

Page 25 of 29

From the Monitor page, the tcp-text-in input should now indicate that 45 events have been received. And
it the TCP Console application, Flight SWA1586 entered the storm and you should have received an event.

As you continue stepping through the data in the GeoEvent Simulator, notice that an event is posted to
the TCP Console every time a flight event is received. Also, observe that the spatial filter allows an event,
whose location is INSIDE one of its referenced GeoFences, to pass through the filter to the tcp-text-out
output.
Module 5 of this tutorial will introduce the Incident Detector Processor which can generate alerts based
on an opening condition. This would allow you to be notified with just a single alert upon a flight
entering a storm, instead of receiving many alerts while the flight is inside the storm. The Notifications
in GeoEvent Processor tutorial explains how to create outputs to send email and SMS message alerts
rather than simply displaying the events in a TCP Console application.

Synchronizing GeoFences with dynamic feature layers


The scenario youve been working through flights entering a storm has focused on a single Rocky
Mountain Storm. The polygon features were exposed through a feature service, manually imported into

Introduction to GeoEvent Processor Module 3

March 2014

Page 26 of 29

GeoEvent Processor to create GeoFences, and filters were then used to evaluate spatial conditions on
those features.
Oftentimes, feature services are dynamic and it would not be practical to manually import new
GeoFences every time you wanted to use an updated set of polygons from a feature layer. This section
will discuss how GeoEvent Processor can be configured to automatically synchronize its GeoFences with
the geometry provided by a feature service.
You may have noticed, when importing GeoFences, that the GeoFences page (Site > GeoEvent Processor
> GeoFences) had two buttons one to manually import GeoFences and one to setup automatic
synchronization of GeoFences with an identified feature layer. Clicking Synchronize GeoFences opens the
property dialog used to configure active synchronization of GeoFences.

In the illustration above, the value StormHazards was entered manually by typing the property value.
The Category Field is also has a drop-down, allowing fields containing Strings to be selected and used to
name the category into which imported GeoFences should be placed.
Name Field is a drop-down allowing fields containing either String or Integer values to be selected and
used as the attribute field from which a unique identifier can be retrieved. Every GeoFence imported
into GeoEvent Processor must have a unique name in the illustration the field StormName provides a
unique name for each storm imported as a GeoFence.
Active Field is a drop-down allowing fields containing either true or false values to specify whether a
particular GeoFence is active or should be disregarded because it is inactive. The (Always Active) default
was used in this example because the Storms feature service does not have a suitable field to use for
dynamically activating and deactivating GeoFences as GeoEvent Processor conducts GeoFence
synchronization.

Introduction to GeoEvent Processor Module 3

March 2014

Page 27 of 29

Refresh Interval is important for overall system performance. You should specify a time interval which
reflects how often the feature layer is realistically updated. Entering too short an interval will result in
GeoEvent Processor frequently polling the feature service unnecessarily, which will impact performance.
Entering too long an interval may result in spatial conditions being evaluated against areas of interest
which have become stale.
The WKID properties default value 4326 is the well-known identifier of the WGS 1984 geographic
coordinate system. For best performance you should specify the WKID of the spatial reference used by
GeoEvents you expect to receive. All of the simulated data for these exercises express global positions
using latitude and longitude, which is why the default WKID 4326 is used.
You can improve GeoEvent Processor performance by simplifying GeoFences when they are imported.
Max Allowable Offset specifies the maximum physical distance that the simplified polygon can deviate
from the original one. Larger values result in more general GeoFences being used, which are faster for
spatial comparisons, but less accurate. The value is left blank for these exercises.
The GeoEvent Processor Manager lists its GeoFence Synchronizations on the GeoFences page.

This page must be refreshed before changes to a known set of GeoFences will be listed, since
synchronization occurs in the background.
If you are interested in experimenting with GeoFence synchronization, refer to the steps below to add a
new polygon to the Storms feature service and configure GeoEvent Processor to synchronize its known
GeoFences with the updated feature service.
1. Delete any GeoFences you have manually imported into GeoEvent Processor. GeoFence
synchronization will not overwrite existing GeoFences that have been manually imported.
2. Use the Synchronize GeoFences dialog illustrated above to configure the GeoFence synchronization.
The illustration uses the Storms feature service as the source of the polygon geometries for
GeoFences.
3. Navigate to the REST endpoint for the Storms feature layer.
http://localhost:6080/arcgis/rest/services/IntroToGEP/Storms/FeatureServer/0/addFeatures
4. Browse to and open the polygon.txt file in the \data\WorkingWithFilters folder included
with this tutorial.
5. Copy and paste all of the JSON block text from the polygon.txt file into the Features property field
on the REST endpoint.
6. Set the Format to JSON.

Introduction to GeoEvent Processor Module 3

March 2014

Page 28 of 29

7. Click Add Features.


The REST endpoint should return a message indicating success or failure. If the feature addition was
successful, a second polygon should be displayed over the east coast of the United States when viewing
the Flights web map in the Operations Dashboard.
If GeoFence synchronization was configured correctly, the new GeoFence will be automatically imported
and available when GeoEvent Processor next polls the feature service.

Congratulations!
By completing the exercises in this module you have learned how to configure and incorporate filters
into GeoEvent Services that you design and publish using GeoEvent Processor Manager.
Events received by an input contain information and an input relies on a GeoEvent Definition to
interpret this information and construct a GeoEvent, which a GeoEvent Service can then process. When
designing filters, it is important to understand the role of GeoEvent Definitions. Since GeoEvent
Definitions specify the data types used to represent event data, they control which operators are
applicable when developing the expressions included in a filter.
Through exercises in this module you also learned how to create filters which use attribute as well as
spatial expressions to filter event data. You learned how to import GeoFences necessary when filtering
events based on their location and how to design filters that use event information such as a GeoEvent
Definition name or a GeoEvent tag that has been applied to a field in a GeoEvent Definition. You also
learned how expressions can be logically combined within a single filter using AND / OR operations.
In Module 4, you will configure and incorporate processors into GeoEvent Services. You will be
introduced to the different types of processors and will incorporate the different processors into a
simple GeoEvent Service. Combining what you learned about event filtering with what you will learn
about event processing, you should be able to quickly begin designing and publishing sophisticated
GeoEvent Services.

Introduction to GeoEvent Processor Module 3

March 2014

Page 29 of 29

Potrebbero piacerti anche