com.oracle.cep.cartridge.spatial.Geometry Methods
16.2.1 How to Access the Geometry Types That the Oracle Spatial Java API Supports
This procedure describes how to access Oracle Spatial geometry types SDO_GTYPE, SDO_ELEMENT_INFO, and ORDINATES using Oracle Spatial in an Oracle CQL query. To access the geometry types that the Oracle Spatial Java API supports: 1. Import the package com.oracle.cep.cartridge.spatial into your Oracle CEP application’s MANIFEST.MF file. For more information, see How to Import a Package in the Oracle Complex Event Processing Developers Guide for Eclipse.2. Define your Oracle CEP application event type using the appropriate Oracle
Spatial data types. Example 16–4 shows how to define event type MySpatialEvent with two event properties x and y of type com.oracle.cep.cartridge.spatial.Geometry. Example 16–4 Oracle CEP Event Using Oracle Spatial Types wlevs:event-type-repository wlevs:event-type type-name=MySpatialEvent wlevs:properties wlevs:property name=x type=com.oracle.cep.cartridge.spatial.Geometry wlevs:property name=y type=com.oracle.cep.cartridge.spatial.Geometry wlevs:properties wlevs:event-type wlevs:event-type-repository You can use these event properties in an Oracle CQL query like this: CONTAINspatialx, y, 20.0d For more information, see Overview of Oracle CEP Events in the Oracle Complex Event Processing Developers Guide for Eclipse. 3. Choose an SDO_GTYPE, for example, GTYPE_POLYGON. For more information, see Section 16.1.2.1, Geometry Types . 4. Choose the Element Info appropriate for your ordinates. For more information, see Section 16.1.2.2, Element Info Array 5. Define your coordinate values. For more information, see Section 16.1.2.3, Ordinates and Coordinate Systems and the SDO_SRID . 6. Create your Oracle CQL query as Example 16–5 shows. Example 16–5 Oracle CQL Query Using Oracle Spatial Geometry Types view id=ShopGeom select com.oracle.cep.cartridge.spatial.Geometry.createGeometryspatial com.oracle.cep.cartridge.spatial.Geometry.GTYPE_POLYGON, com.oracle.cep.cartridge.spatial.Geometry.createElemInfo1, 1003, 1, ordsgeneratorspatial lng1, lat1, lng2, lat2, lng3, lat3, lng4, lat4, lng5, lat5, lng6, lat6 Oracle Spatial 16-11 as geom from ShopDesc view16.2.2 How to Create a Geometry
You can use Oracle Spatial to create a geometry in an Oracle CQL query by invoking: ■ static methods in com.oracle.cartridge.spatial.Geometry ■ methods in oracle.spatial.geometry.JGeometry that conform to the scope and geometry types that Oracle Spatial supports. For more information, see Section 16.1.2.7, Geometry API . Using a Static Method in the Oracle Spatial Geometry Class Example 16–6 shows how to create a point geometry using a static method in com.oracle.cartridge.spatial.Geometry. In this case, you must use a link spatial to identify the data cartridge that provides this class. The advantage of using this approach is that the Oracle Spatial application context is applied to set the SRID and other Oracle Spatial options, either by default or based on an application context you configure see Section 16.1.4, Oracle Spatial Application Context . Example 16–6 Creating a Point Geometry Using a Geometry Static Method view id=CustomerPosGeom select com.oracle.cep.cartridge.spatial.Geometry.createPointspatial lng, lat as geom from CustomerPos[NOW] view For more information, see Section 16.1.2.1, Geometry Types .16.2.3 How to Access Geometry Type Public Methods and Fields
Using Oracle Spatial, you can access the public member functions and public member fields of Oracle Spatial classes directly in Oracle CQL. Oracle Spatial functionality inaccessible from the Geometry class or not conforming to the scope and geometry types that Oracle Spatial supports is inaccessible from Oracle Spatial. In Example 16–7 , the view ShopGeom creates an Oracle Spatial geometry called geom. The view shopMBR calls JGeometry static method getMBR which returns a double[] as stream element mbr. The query qshopMBR accesses this double[] using regular Java API. Example 16–7 Accessing Geometry Type Public Methods and Fields view id=ShopGeom select com.oracle.cep.cartridge.spatial.Geometry.createGeometryspatial com.oracle.cep.cartridge.spatial.Geometry.GTYPE_POLYGON, com.oracle.cep.cartridge.spatial.Geometry.createElemInfo1, 1003, 1, ordsgeneratorspatial lng1, lat1, lng2, lat2, lng3, lat3, lng4, lat4, lng5, lat5, lng6, lat6 as geomParts
» Oracle Fusion Middleware Online Documentation Library
» Streams and Channels Oracle CEP represents a stream as a channel as
» Channel Schema The event source you connect to a stream determines the
» Querying a Channel Once the event source, channel, and processor are
» Controlling Which Queries Output to a Downstream Channel If you specify more
» Relations Relations and Oracle CEP Tuple Kind Indicator
» Range, Rows, and Slide at Query Start-Up and for Empty Relations The descriptions
» Partition Stream-to-Relation Operators Windows
» Default Stream-to-Relation Operator Stream-to-Relation Operators Windows
» Relation-to-Relation Operators Stream-to-Stream Operators
» Event Sources Event Sources and Event Sinks
» Relational Database Table Event Sources
» Function Table Event Sources
» Pattern Recognition Cache Event Sources Functions
» Data Cartridges Fundamentals of Oracle CQL
» Lexical Conventions Oracle CQL Statements
» Oracle CQL and SQL Standards
» Oracle CEP Visualizer Oracle CEP Tools
» Oracle CQL Built-in Datatypes
» Numeric Values Datatype Comparison Rules
» Date Values Datatype Comparison Rules
» Implicit Datatype Conversion Datatype Conversion
» Explicit Datatype Conversion Datatype Conversion
» SQL Datatype Conversion Datatype Conversion
» Oracle Data Cartridge Datatype Conversion
» User-Defined Function Datatype Conversion
» Integer Literals Numeric Literals
» Floating-Point Literals Numeric Literals
» Text Literals Datetime Literals
» Number Format Models Format Models
» Aliases in the relation_variable Clause
» How to Define a Data Type Alias Using the Aliases Element
» Schema Object Naming Guidelines Schema Object Naming Examples
» ELEMENT_TIME for a System-Timestamped Stream
» Using ELEMENT_TIME With SELECT
» Using ELEMENT_TIME With GROUP BY
» Using ELEMENT_TIME With PATTERN
» What You May Need to Know About Unary and Binary Operators
» What You May Need to Know About Operator Precedence
» Comparison Conditions Oracle Fusion Middleware Online Documentation Library
» Logical Conditions Oracle Fusion Middleware Online Documentation Library
» Range Conditions Oracle Fusion Middleware Online Documentation Library
» Null Conditions Compound Conditions
» Using IN and NOT IN as a Set Operation Using IN and NOT IN as a Membership Condition
» Introduction to Common Oracle CQL DDL Clauses
» Introduction to Oracle CQL Built-In Single-Row Functions
» Built-In Aggregate Functions and the Where, Group By, and Having Clauses
» Introduction to Oracle CQLBuilt-In Single-Row Colt Functions
» double c Oracle Fusion Middleware Online Documentation Library
» Introduction to Oracle CQL Built-In java.lang.Math Functions
» User-Defined Single-Row Functions Types of User-Defined Functions
» How to Implement a User-Defined Single-Row Function
» How to Implement a User-Defined Aggregate Function
» Data Cartridge Name Data Cartridge Application Context
» Oracle CQL Data Cartridge Types
» Application Class Space Policy
» No Automatic Import Class Space Policy Server Class Space Policy
» Class Loading Example Class Loading
» Data Cartridge Name Method Resolution
» How to Query Using the Java API How to Query Using Exported Java Classes
» Data Cartridge Name Understanding Oracle Spatial
» Element Info Array Ordinates and Coordinate Systems and the SDO_SRID
» Geometric Relation Operators Scope
» com.oracle.cep.cartridge.spatial.Geometry Methods
» oracle.spatial.geometry.JGeometry Methods The following JGeometry public
» Datatype Mapping Oracle Spatial Application Context
» How to Access the Geometry Types That the Oracle Spatial Java API Supports
» How to Create a Geometry How to Access Geometry Type Public Methods and Fields
» Data Cartridge Name Understanding the Oracle CEP JDBC Data Cartridge
» Scope Understanding the Oracle CEP JDBC Data Cartridge
» Datatype Mapping Understanding the Oracle CEP JDBC Data Cartridge
» function Element Attributes Defining SQL Statements: function Element
» Multiple Parameter JDBC Cartridge Context Functions Using the Oracle CEP
» Overloading JDBC Cartridge Context Functions Using the Oracle CEP JDBC data
» Using SELECT List Aliases Using the TABLE Clause
» Using a Native CQL Type as a return-component-type
» How to Create an Oracle CQL Query
» Where Clause Query Building Blocks
» MATCH_RECOGNIZE Query Queries
» Relational Database Table Query XMLTable Query
» Function TABLE Query Queries
» Sorting Query Results Queries
» Detecting Differences in Query Results
» Parameterized Queries in Oracle CQL Statements
» The bindings Element Parameterized Queries
» Run-Time Query Naming Lexical Conventions for Parameter Values
» Views and Joins Views and Schemas
» Cache Key First and Simple Equality No Arithmetic Operations on Cache Keys
» Oracle CQL Queries and Oracle Data Cartridges
» MATCH_RECOGNIZE and the WHERE Clause Referencing Singleton and Group Matches
» Running Aggregates and Final Aggregates
» Operating on the Same Correlation Variable Referencing Variables That Have not Been Matched Yet
» Using prev Understanding Pattern Recognition With MATCH_RECOGNIZE
» Functions Over Correlation Variables in the MEASURES Clause
» Pattern Quantifiers and Regular Expressions
» Referencing One Correlation Variable From Another in the DEFINE Clause
» PARTITION BY Clause Oracle Fusion Middleware Online Documentation Library
» ORDER BY Clause ALL MATCHES Clause
» WITHIN Clause Oracle Fusion Middleware Online Documentation Library
» Fixed Duration Non-Event Detection
» Recurring Non-Event Detection DURATION Clause
» INCLUDE TIMER EVENTS Clause SUBSET Clause
» Pattern Detection MATCH_RECOGNIZE Examples
» Pattern Detection With PARTITION BY
Show more