Element Info Array Ordinates and Coordinate Systems and the SDO_SRID

Oracle Spatial 16-7 ■ ordsgenerator on page 16-34

16.1.2.7.1 com.oracle.cep.cartridge.spatial.Geometry Methods

Table 16–4 lists the public methods that the Geometry class provides. Note: To simplify Oracle Spatial type names, you can use aliases as Section 2.8.2, Defining Aliases Using the Aliases Element describes. Table 16–4 Oracle Spatial Geometry Methods Type Method Buffers ■ bufferPolygon Distance ■ distance Element information ■ createElemInfo Geometries ■ createGeometry Linear polygons ■ createLinearPolygon Minimum Bounding Rectangle MBR ■ get2dMbr Points ■ createPoint Rectangles ■ createRectangle Type and type conversion ■ to_Geometry ■ to_JGeometry Note: Geometry class methods are case sensitive and you must use them in the case shown. Note: If you use a com.oracle.cep.cartridge.spatial.Geometry method that does not take an SDO_SRID value, then you must use the Oracle Spatial application context. For example, the following method call will cause a runtime exception: com.oracle.cep.cartridge.spatial.Geometry.createPointlng, lat Instead, you must use the spatial link name to associate the method call with the Oracle Spatial application context: com.oracle.cep.cartridge.spatial.Geometry.createPointspatiallng, lat If you use a Geometry method that takes an SDO_SRID value, then the use of the spatial link name is optional. For example, both the following method calls are valid: com.oracle.cep.cartridge.spatial.Geometry.createPoint8307, lng, lat com.oracle.cep.cartridge.spatial.Geometry.createPointspatiallng, lat For more information, see Section 16.1.4, Oracle Spatial Application Context . 16-8 Oracle Complex Event Processing CQL Language Reference

16.1.2.7.2 oracle.spatial.geometry.JGeometry Methods The following JGeometry public

methods are applicable to Oracle Spatial: ■ double areadouble tolerance: returns the total planar surface area of a 2D geometry. ■ double lengthdouble tolerance: returns the perimeter of a 2D geometry. All edge lengths are added. ■ double[] getMBR: returns the Minimum Bounding Rectangle MBR of this geometry. It returns a double array containing the minX, minY, maxX, and maxY value of the MBR for 2D. For more information, see: ■ http:download.oracle.comdocscdB28359_ 01appdev.111b28401oraclespatialgeometryJGeometry.html

16.1.3 Datatype Mapping

The Oracle Spatial cartridge supports one data type: com.oracle.cep.cartridge.spatial.Geometry. For a complete list of the methods that com.oracle.cep.cartridge.spatial.Geometry provides, see Section 16.1.2.7, Geometry API .

16.1.4 Oracle Spatial Application Context

You can define an application context for an instance of Oracle Spatial and propagate this application context at runtime. This allows you to associate specific Oracle Spatial application defaults such as an SDO_SRID with a particular Oracle Spatial instance. Before you can define an Oracle Spatial application context, edit your Oracle CEP application EPN assembly file to add the required namespace and schema location entries as Example 16–1 shows: Example 16–1 EPN Assembly File: Oracle Spatial Namespace and Schema Location ?xml version=1.0 encoding=UTF-8? beans xmlns=http:www.springframework.orgschemabeans xmlns:xsi=http:www.w3.org2001XMLSchema-instance xmlns:osgi=http:www.springframework.orgschemaosgi xmlns:wlevs=http:www.bea.comnswlevsspring xmlns:spatial=http:www.oracle.comnsocepspatial xsi:schemaLocation= http:www.springframework.orgschemabeans http:www.springframework.orgschemabeansspring-beans.xsd http:www.springframework.orgschemaosgi http:www.springframework.orgschemaosgispring-osgi.xsd http:www.bea.comnswlevsspring http:www.bea.comnswlevsspringspring-wlevs-v11_1_1_3.xsd http:www.oracle.comnsocepspatial http:www.oracle.comnsocepspatialocep-spatial.xsd Example 16–2 shows how to create a spatial context named SpatialGRS80 in an EPN assembly file using the Geodetic Reference System 1980 GRS80 coordinate system. Example 16–2 spatial:context Element in EPN Assembly File spatial:context id=SpatialGRS80 srid=4269 sma=6378137 rof=298.25722101