Section 15.1, "Understanding Data Cartridge Application Context"
Section 15.2, "How to Configure Oracle Spatial Data Cartridge Application Context"
For more information on data cartridges, see "Introduction to Data Cartridges" in the Oracle CEP CQL Language Reference.
Depending on the data cartridge implementation, you may be able to define an application context that the Oracle CEP server propagates to an instance of the data cartridge and the complex objects it provides.
You may configure an application context for the following data cartridges:
For more information on data cartridges, see "Introduction to Data Cartridges" in the Oracle CEP CQL Language Reference.
You define an application context for an instance of an Oracle Spatial data cartridge using element spatial:context
in your Oracle CEP application's Event Processing Network (EPN) assembly file.
All constructors and methods from com.oracle.cartridge.spatial.Geometry
and Oracle Spatial data cartridge functions are aware of spatial:context
. For example, the SRID is automatically set from the value in the Oracle Spatial data cartridge application context.
To configure Oracle Spatial data cartridge application context:
Open the EPN editor in the Oracle CEP IDE for Eclipse.
Right-click any component and select Go to Assembly Source.
Edit the EPN file to add a spatial:context
element as Example 15-1 shows.
Assign a value to the id
attribute that is unique in this EPN.
This is the name you will use to reference this application context in subsequent Oracle CQL queries. In Example 15-1, the id
is SpatialGRS80
.
Note:
Theid
value must not equal the Oracle Spatial data cartridge name spatial
. For more information, see "Data Cartridge Name" in the Oracle CEP CQL Language Reference.Configure the other attributes of the spatial:context
element to suit your application requirements.
Table 15-1 lists the attributes of the spatial:context
element.
Table 15-1 spatial:context Element Attributes
Attribute | Description |
---|---|
The default tolerance for contain or inside operator. Default: 0.0000005 |
|
Defines the Reciprocal Of Flattening ( Default: 298.257223563 |
|
Defines the Semi-Major Axis ( Default: 6378137.0 |
|
SRID integer. Valid values are:
Default : For more information, see "SDO_SRID" in the Oracle Spatial Developer's Guide. |
|
The minimum distance to be ignored in geometric operations including buffering. Default: 0.000000001 |
Example 15-2 shows how to create a spatial context named SpatialGRS80
in an EPN assembly file using the Geodetic Reference System 1980 (GRS80) coordinate system (srid="4269"
).
Create Oracle CQL queries that reference this application context by name.
Example 15-3 shows how to reference a spatial:context
in an Oracle CQL query. In this case, the query uses link name SpatialGRS80
(defined in Example 15-1) to propagate this application context to the Oracle Spatial data cartridge. The spatial:context
attribute settings of SpatialGRS80
are applied to the createPoint
method call. Because the application context defines the SRID, you do not need to pass that argument into the createPoint
method.
Example 15-3 Referencing spatial:context in an Oracle CQL Query
<view id=”createPoint”> select com.oracle.cep.cartridge.spatial.Geometry.createPoint@SpatialGRS80( lng, lat, 0d) from CustomerPos[NOW]</view>
For more information on creating Oracle CQL queries using the Oracle Spatial data cartridge, see "Using the Oracle Spatial Data Cartridge" in the Oracle CEP CQL Language Reference.