Académique Documents
Professionnel Documents
Culture Documents
March 2014
Page 2 of 17
Appendix A Overview
Material in this appendix is intended to go beyond the introductory exercises presented in the various
modules of this tutorial and provide a deeper dive into specific topics highlighted by questions sent to
the product development team from users.
It is occasionally necessary to limit an exercises narrative in order to focus on a particular concept for
users unfamiliar with the product. One example is the different ways coordinate values can be specified
in a simulation file. Coordinate values in the simulation files used in the exercises are generally specified
in decimal degrees for a Geographic Coordinate System (GCS), for example, when GeoEvent Processor
and the GeoEvent Simulator are perfectly capable of handling coordinate values expressed in linear
units for a Projected Coordinate System (PCS).
There are also certain tips or tricks analysts can use to work with data modeled within a GeoEvent. For
example, date/time values can be offset by subtracting a numeric value from (or adding a numeric value
to) the date using a Field Calculator processor. A Field Calculator can also be used to generate a JSON
string which a Field Mapper can interpret as a Geometry. Details such as these, if included in an exercise
narrative, tend to distract students seeking to learn the basics of the product. These nuggets are then
hard to locate later once an analyst has had a chance to work with the GeoEvent Processor.
If you discover an innovative design for a GeoEvent Service, or uncover a configuration for an Input,
Output, Processor, or Filter which solves a particular problem, please share your success on our ArcGIS
GeoEvent Processor Forum: http://forums.arcgis.com/forums/257-GeoEvent-Processor
In the illustration above, the events location is a single value presented as a string. The coordinates in
the string are assumed to be in decimal degrees, implying a Geographic Coordinate System (GCS), with
the longitude preceding the latitude. Specifying the values as a quoted string allows the text adapter used
by the Input to apply special handling in order to interpret the value as a location. If you look closely at
the GeoEvent Definition in exercises which use this shortcut, you will see that the quoted pair of values is
handled as a Geometry. The Input is actually doing quite a bit of work to convert the pair of coordinates
from a simple string into the expected Geometry data type.
March 2014
Page 3 of 17
Notice that the coordinate values for the latter simulation file, while still in decimal degrees for a GCS,
are expressed as separate data values. The Build Geometry From Fields option is explicitly selected in the
exercise in Module 2 so that the Input will retrieve the coordinate values individually and use them to
construct a Geometry.
Notice in the illustration above that the parameters below X Geometry Field and Y Geometry Field have
been left empty. The exercise is allowing the Input to continue to assume a Geographic Coordinate
System specifically the WGS84 coordinate system whose WKID (Well-Known Identifier) is 4326.
When event data expresses coordinate values in linear units such as meters or feet (rather than decimal
degrees), the most reliable and flexible approach is to have each event include the numeric WKID of the
projected coordinate system associated with the events coordinate values. When each event specifies
March 2014
Page 4 of 17
both its coordinate values and a projection identifier for those coordinates events can potentially express
locations in a variety of different projections.
The illustration below shows how an Input using the Text adapter (the adapter coupled with the Receive
text from a TCP Socket used in the exercise in Module 2) would be configured to support coordinates in
linear units for a Projected Coordinate System. Notice that the coordinates are obtained from the events
fields, as they are in the illustration on the previous page. However, the GeoEvent Definition created for
these events, SiteData-TcpTextIn (see illustration next page), specifies event fields XCoord, YCoord, and
WKID rather than just Longitude and Latitude.
Event data, with coordinates for the StatePlane Colorado North (US Feet) coordinate system, might look
something like the following where 103012 is the WKID for the projected coordinate system:
The SiteData-TcpTextIn event definition illustrated below supports the comma separated simulation data
illustrated on the previous page. Notice that the event definition contains an extra field named Location.
The Input will place the Geometry it builds using the events XCoord, YCoord, and WKID into this field.
March 2014
Page 5 of 17
The next section will take a look at how a Field Calculator can be used to build a Geometry using data
obtained from an events fields rather than relying on an Input component to do this.
March 2014
Page 6 of 17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"SiteID": "9c272a7d-3698-4cb0-95db-c4dbecd4ddae",
"Description": "Northern Colorado - Fort Collins area",
"Projection": "NAD 1983 (2011) SPCS Colorado North - FIPS 0501 (US Feet)",
"WKID": 103012,
"Sites": [
{
"SiteName": "Alpha",
"LastUpdated": "5/27/2012 13:26:33 PM",
"YCoord": 1453029.6,
"XCoord": 3122232.5
},
{
"SiteName": "Bravo",
"LastUpdated": "5/27/2012 13:26:39 PM",
"YCoord": 1448394.2,
"XCoord": 3124125
},
{
"SiteName": "Charlie",
"LastUpdated": "5/27/2012 13:26:45 PM",
"YCoord": 1450295.2,
"XCoord": 3131863.7
},
{
"SiteName": "Delta",
"LastUpdated": "5/27/2012 13:26:51 PM",
"YCoord": 1442298.3,
"XCoord": 3126221.3
},
{
"SiteName": "Echo",
"LastUpdated": "5/27/2012 13:26:59 PM",
"YCoord": 1435510.1,
"XCoord": 3119598.1
},
{
"SiteName": "Foxtrot",
"LastUpdated": "5/27/2012 13:27:03 PM",
"YCoord": 1428817.4,
"XCoord": 3125118.9
},
{
"SiteName": "Golf",
"LastUpdated": "5/27/2012 13:27:13 PM",
"YCoord": 1418374.7,
"XCoord": 3133426.2
}
]
}
March 2014
Page 7 of 17
For this example lets assume that the number of site elements in the Sites list is variable or unknown, so
we would prefer to receive each site as a separate GeoEvent.
An Input suitable for receiving JSON via a REST endpoint can be used to generate an event definition with
the Sites element treated as the root element of the JSON structure. Information from the header will not
be available as the event definition only provides access to fields in site record.
Notice that the name of the GeoEvent Definition in the illustration above includes a descriptive keyword
AutoGenerated. Once event data has been received and you have had a chance to review the generated
event definition, it is recommended that the Input be reconfigured to specify an event definition to use
rather the continuing to allow the Input to create one based on data discovery.
In the illustration below, the generated event definition has been copied and renamed. Notice that the
analyst, not the Generic-JSON inbound adapter, is identified as the GeoEvent Definition owner. The event
definition SiteData-JSON-AutoGenerated was deleted.
Having reconfigured the Input to use the SiteData-JSON event definition illustrated on the previous page,
we can now design a GeoEvent Service incorporating the Input and a Field Calculator which will build a
JSON string using the XCoord and YCoord values from each event. The JSON string will be compatible with
the Esri Feature schema for a Point Geometry.
March 2014
Page 8 of 17
The JSON string is built by entering the necessary literal strings and field names into the Field Calculator
processors Expression parameter. Consider the following illustration, which breaks the expression into
multiple lines to better show the literal string values within the pairs of single-quotes:
The expression would need to be entered on a single line when configuring the Field Calculator.
The Field Calculator builds a String representation of an Esri Feature compliant Point Geometry. The
string value must be converted to an actual Geometry data type before it can be used as a Geometry.
This can be accomplished with a Field Mapper processor.
Remember, when updating or adding features to a published Feature Service, it is recommended that
you import a GeoEvent Definition from the target feature layer and incorporate a Field Mapper
processor if necessary to ensure that event data being output from a GeoEvent Service matches the
targeted feature layers schema.
March 2014
Page 9 of 17
March 2014
Page 10 of 17
The illustration below shows the JSON returned when a polyline feature layer is queried from a published
feature service. In the illustration, a single polyline feature has been expanded to show both its attribute
values and the five vertices making up its geometry.
When creating a JSON text representation of a polyline for a GeoEvent simulation file, we only want the
geometry portion of the JSON block. Also, the keyword geometry will be assumed, so we only want to
take the paths element with its enclosing curl-braces.
Consider the illustration on the next page. The paths element has been highlighted in yellow and the
needed curl-braces are indicted with red arrows.
March 2014
Page 11 of 17
Reducing the JSON indicated in the illustration above to a single line of text, and adding the necessary
quotation characters, we obtain the JSON string we need for the comma separated event simulation file.
The numeric precision has been reduced to better communicate the structure of the string.
"{ ""paths"": [ [ [ -117.2619, 32.2951 ], [ -117.2586, 32.2970 ], [ 117.2568, 32.3006 ], [ -117.2541, 32.3032 ], [ -117.2508, 32.3080 ] ] ] }"
The illustration below shows the JSON incorporated into a simulation file.
The illustrations below show other configurable elements, such as the GeoEvent Definitions and
GeoEvent Service, used to validate that the simulation data illustrated on the previous page can
be used to add features to feature layer within a published feature service.
March 2014
Page 12 of 17
The illustrations below summarize how to design a simulation file whose events have associated
polygons rather than polylines.
First, either identify or develop a JSON structure with a rings element:
March 2014
Page 13 of 17
Next, reduce the JSON to a single line of text, adding the necessary quotation characters. The numeric
precision below has again been reduced to better communicate the structure of the string.
"{ ""rings"": [ [
117.2568, 32.3006
117.2469, 32.3059
117.2577, 32.2941
[ -117.2619, 32.2951 ],
], [ -117.2541, 32.3032
], [ -117.2494, 32.3032
], [ -117.2619, 32.2951
Finally, incorporate the JSON describing the polygon into a comma separated simulation file.
March 2014
Page 14 of 17
March 2014
Page 15 of 17
dd-MM-yyyy HH:mm
March 2014
Page 16 of 17
March 2014
Page 17 of 17