Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20001 Oracle 8i Extensibility & Spatial Presented By: Jayant Sharma

Similar presentations


Presentation on theme: "Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20001 Oracle 8i Extensibility & Spatial Presented By: Jayant Sharma"— Presentation transcript:

1 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20001 Oracle 8i Extensibility & Spatial Presented By: Jayant Sharma Jayant.Sharma@oracle.com Presented By: Jayant Sharma Jayant.Sharma@oracle.com

2 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20002 Outline Extensibility Framework –Type system –Indexing –Optimizer Oracle Spatial –Features –Usage examples Extensibility Framework –Type system –Indexing –Optimizer Oracle Spatial –Features –Usage examples

3 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20003 Extensibility Framework Optimizer Query Engine Index Engine Type Manager Extensibility Utilities Tools Text Spatial Image Spatial Image Spatial Image Callouts

4 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20004 Object Types Ability to define new data types –A type system to support user defined object types –Made up of predefined types or user- defined types Type Methods (PL/SQL, C, Java) Ability to define new data types –A type system to support user defined object types –Made up of predefined types or user- defined types Type Methods (PL/SQL, C, Java)

5 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20005 LOBs Helps capture unstructured data Stored inside or outside database, can be temporary Piecewise access to LOB data Three types of LOBs - CLOB, BLOB, BFILE Helps capture unstructured data Stored inside or outside database, can be temporary Piecewise access to LOB data Three types of LOBs - CLOB, BLOB, BFILE LOBs can be stored in a separate tablespace or in operating system files Table BFILE BLOB

6 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20006 Oracle DB Oracle Address SpaceExternal Address Space External Procedures Oracle 8i PL/SQLListener extproc /sh_libs/utils.so

7 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20007 Outline Extensible Type System Extensible Indexing Extensible Optimizer Extensible Type System Extensible Indexing Extensible Optimizer

8 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20008 What is an Index ? Compressed representation of relevant information Used to efficiently obtain result set for queries (with or without predicates) Compressed representation of relevant information Used to efficiently obtain result set for queries (with or without predicates)

9 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20009 Built-in Indexes B-Tree Index –(key,ROWID) stored in a tree –used for predicates with relational operators Bitmap Index –stores a bitmap per key value –handles relational operators B-Tree Index –(key,ROWID) stored in a tree –used for predicates with relational operators Bitmap Index –stores a bitmap per key value –handles relational operators

10 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200010 Built-in Indexing Limitations Can NOT use index to evaluate predicates containing relational operators with: –LONG and LOB columns –Object Types columns –VARRAY columns –Nested Table columns Can NOT use index to evaluate predicates containing relational operators with: –LONG and LOB columns –Object Types columns –VARRAY columns –Nested Table columns SELECT * FROM T WHERE C1 = :1; SELECT * FROM T WHERE C1 = :1;

11 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200011 Built-in Indexing Limitations Can NOT use index to evaluate predicates containing user-defined functions SELECT * FROM employees WHERE age(emp) > 30; SELECT * FROM employees WHERE age(emp) > 30;

12 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200012 Built-in Indexing Limitations Can NOT use index to efficiently evaluate domain-specific operators SELECT * FROM Documents WHERE Contains(Doc,’Oracle’)=1; SELECT * FROM Roads WHERE Overlaps(Rd, Region(..))=1; SELECT * FROM Images WHERE Similar(Img, :1)=1; SELECT * FROM Documents WHERE Contains(Doc,’Oracle’)=1; SELECT * FROM Roads WHERE Overlaps(Rd, Region(..))=1; SELECT * FROM Images WHERE Similar(Img, :1)=1;

13 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200013 Built-in vs. Extensible Indexing All aspects of indexing handled by DBMS A single B-tree used as storage DBMS builds as well as interpret the index for evaluating relational operators All aspects of indexing handled by DBMS A single B-tree used as storage DBMS builds as well as interpret the index for evaluating relational operators Application and DBMS share responsibility Application controls semantic content of index DBMS handles physical storage of related data structures Application interprets the index for evaluating operators

14 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200014 Integration with RDBMS Interoperability of Domains Better Optimization Opportunities Uniform easy SQL access Interoperability of Domains Better Optimization Opportunities Uniform easy SQL access

15 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200015 Operators Domain specific operation Multiple bindings Evaluate using function or index Domain specific operation Multiple bindings Evaluate using function or index CREATE OPERATOR Contains BINDING (CLOB, VARCHAR2) RETURN NUMBER USING Text.Contains, (Spatial.Geo, Spatial.Geo) RETURN NUMBER USING Spatial.Contains; SELECT * FROM employees WHERE Contains(resume, ‘Oracle’) = 1; CREATE OPERATOR Contains BINDING (CLOB, VARCHAR2) RETURN NUMBER USING Text.Contains, (Spatial.Geo, Spatial.Geo) RETURN NUMBER USING Spatial.Contains; SELECT * FROM employees WHERE Contains(resume, ‘Oracle’) = 1;

16 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200016 Predicate Forms op(…) relop –relop: =,, = op(…) BETWEEN AND op(…) LIKE op(…) relop –relop: =,, = op(…) BETWEEN AND op(…) LIKE

17 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200017 Operator Evaluation Operator evaluated as –Functional implementation or –Domain Index Scan Index Scan chosen iff –column arg has domain index –indextype supports operator Cost based optimizer Operator evaluated as –Functional implementation or –Domain Index Scan Index Scan chosen iff –column arg has domain index –indextype supports operator Cost based optimizer

18 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200018 Multi Domain Queries Single query with multiple operators SELECT * FROM patients WHERE Contains(history, ‘tumor’) = 1 AND Overlaps(location, :bay_area) = 1 AND Similar(xray, :tumorscan) = 1; SELECT * FROM patients WHERE Contains(history, ‘tumor’) = 1 AND Overlaps(location, :bay_area) = 1 AND Similar(xray, :tumorscan) = 1;

19 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200019 Agenda Extensible Type System Extensible Indexing Extensible Optimizer Extensible Type System Extensible Indexing Extensible Optimizer

20 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200020 Cost Based Optimizer Query Hints Statistics Execution Plan C(P1) C(P2) C(P3) C(Pn) CBO (min)

21 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200021 Execution Plan Characteristics Cost of query execution depends upon: –Cost of Join methods –Cost of Access methods –Cost of function invocation Selectivity of predicates Statistics of columns or indexes Cost of query execution depends upon: –Cost of Join methods –Cost of Access methods –Cost of function invocation Selectivity of predicates Statistics of columns or indexes

22 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200022 Why Extensible Optimizer l Extensible framework allows new access methods l Cannot ignore the cost of user-defined functions l User-defined Types l More applications and cartridges are using new access methods and complex user-defined functions l Extensible framework allows new access methods l Cannot ignore the cost of user-defined functions l User-defined Types l More applications and cartridges are using new access methods and complex user-defined functions

23 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200023 Goal l Generate optimal execution plans for queries with predicates involving: n user-defined operators n user-defined functions n object type columns l Generate optimal execution plans for queries with predicates involving: n user-defined operators n user-defined functions n object type columns

24 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200024 Cost & Selectivity l User feedback for estimating cost required for: n User-defined access methods n Functional predicates l User feedback for estimating selectivity required for n Predicates involving user-defined functions l User feedback for estimating cost required for: n User-defined access methods n Functional predicates l User feedback for estimating selectivity required for n Predicates involving user-defined functions

25 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200025 System-Defined Statistics l Information gathered about column or index data to better estimate cost and selectivity n logical - histogram of value distribution, etc. n physical - # of data blocks, etc. l Collected using ANALYZE command l Information gathered about column or index data to better estimate cost and selectivity n logical - histogram of value distribution, etc. n physical - # of data blocks, etc. l Collected using ANALYZE command SELECT * FROM emp WHERE salary < 50000 ANALYZE TABLE emp COMPUTE STATISTICS FOR COLUMNS salary SELECT * FROM emp WHERE salary < 50000 ANALYZE TABLE emp COMPUTE STATISTICS FOR COLUMNS salary

26 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200026 User-Defined Statistics Example - occurrences of keywords in a text column SELECT * FROM emp e WHERE contains(e.resume, ‘Oracle’) = 1 SELECT * FROM emp e WHERE contains(e.resume, ‘Oracle’) = 1

27 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200027 User-Defined Statistics l Columns n statistics for columns of object types n domain specific statistics for columns of scalar type l Domain indexes n structure of domain index is not known to server l Columns n statistics for columns of object types n domain specific statistics for columns of scalar type l Domain indexes n structure of domain index is not known to server

28 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200028 Model ¶ User provides functions for collecting statistics, estimating selectivity and cost · These functions registered with schema objects - e.g. domain index, object type ¸ ANALYZE uses these functions to collect user-defined statistics ¹ Optimizer uses these functions to estimate cost and selectivity ¶ User provides functions for collecting statistics, estimating selectivity and cost · These functions registered with schema objects - e.g. domain index, object type ¸ ANALYZE uses these functions to collect user-defined statistics ¹ Optimizer uses these functions to estimate cost and selectivity

29 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200029 Example CREATE TYPE text_statstype AS OBJECT( member functions ODCIStatsCollect() RETURN NUMBER ) CREATE TABLE emp (resume VARCHAR2(2000), state VARCHAR2) ASSOCIATE STATISTICS WITH COLUMNS emp.resume USING text_statstype ANALYZE TABLE emp ESTIMATE STATISTICS FOR COLUMNS resume SAMPLE SIZE 20 PERCENT CREATE TYPE text_statstype AS OBJECT( member functions ODCIStatsCollect() RETURN NUMBER ) CREATE TABLE emp (resume VARCHAR2(2000), state VARCHAR2) ASSOCIATE STATISTICS WITH COLUMNS emp.resume USING text_statstype ANALYZE TABLE emp ESTIMATE STATISTICS FOR COLUMNS resume SAMPLE SIZE 20 PERCENT

30 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200030 Applications 8i Options –ConText –Spatial –interMedia & Visual Info Retrieval 8i Options –ConText –Spatial –interMedia & Visual Info Retrieval

31 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200031 Oracle 8i Spatial

32 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200032 Point Line string Polygon Polygon with hole Self-crossing line strings Self-crossing polygons Valid Not valid Not valid Geometric Types

33 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200033 Spatial Data Model Elements Geometries Spatial layer Point Linestring Polygon Compound Polygon Compound Linestring release 8i only: circular arcs circles optimized rectangle compound linestring compound polygon

34 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200034 Elements Element 1 Element 2 Element 3 Element 4 Element 5 Element 6 Element 7 Basic building block of a geometry Element types – –Point – –Line – –Polygon – –Compound Linestring – –Compound Polygon Constructed using coordinates Hawaii, USA

35 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200035 Geometry 1 California Geometry 2 Texas Geometry 3 Florida Geometry 4 Hawaii Geometry Represents a spatial feature Consists of an ordered set of primitive elements Uniquely identified with a geometry identifier Represents a spatial feature Consists of an ordered set of primitive elements Uniquely identified with a geometry identifier

36 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200036 Layers Consist of geometries that share a common set of attributes States layer

37 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200037 Query Model Spatial Layer Data Table where coordinates are stored Primary Filter Spatial Index Index retrieves area of interest (window) Reduced Data Set Secondary Filter Spatial Functions Procedures that determine exact relationship Exact Result Set

38 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200038 Primary and Secondary Filter Concept

39 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200039 Spatial Queries Issued through SQL Contains a locational constraint, for example: –Find all policy holders in the projected path of a hurricane –Find all ATMs in my area Issued through SQL Contains a locational constraint, for example: –Find all policy holders in the projected path of a hurricane –Find all ATMs in my area

40 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200040 Spatial Joins A join of two layers based on the spatial component of the layers Implemented using spatial index and spatial operators Example: –Find all the wetlands within the national parks A join of two layers based on the spatial component of the layers Implemented using spatial index and spatial operators Example: –Find all the wetlands within the national parks

41 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200041 Spatial Indexing There are two methods for indexing spatial data: –Fixed tiling –Hybrid tiling The process of indexing spatial data is called tessellation. The results of the tessellation process are stored in the spatial index. The tesselation process is performed by creating the spatial index There are two methods for indexing spatial data: –Fixed tiling –Hybrid tiling The process of indexing spatial data is called tessellation. The results of the tessellation process are stored in the spatial index. The tesselation process is performed by creating the spatial index

42 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200042 SDO_GROUPCODE FIXED_TILE1 FIXED_TILE2 SDO_CODE VAR_TILE1 VAR_TILE2 VAR_TILE3 DBA Determines: – –Number of Tiles = 3 – –Level = 1 DBA Determines: – –Number of Tiles = 3 – –Level = 1 How Geometry is Indexed DBA Determines: – –Number of Tiles = 3 – –Level = 1 DBA Determines: – –Number of Tiles = 3 – –Level = 1

43 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200043 Primary Filter Example - FIXED Compares fixed sized tiles that approximate the area of interest, with fixed sized tiles that approximate each geometry Result is not exact because comparing approximations Compares fixed sized tiles that approximate the area of interest, with fixed sized tiles that approximate each geometry Result is not exact because comparing approximations sdo_level = 2

44 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200044 Primary Filter Example - HYBRID Hybrid filter: – –First does a fixed tile comparison – –Then does a variable tile comparison – –Result is not exact because still comparing geometry approximations Hybrid filter: – –First does a fixed tile comparison – –Then does a variable tile comparison – –Result is not exact because still comparing geometry approximations sdo_numtiles = 8

45 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200045 Spatial Index Metadata The spatial indexing routines require you to populate a table that contains metadata about SDO_GEOMETRY columns The metadata is created under the Oracle user that owns the geometry The metadata view is called USER_SDO_GEOM_METADATA For every SDO_GEOMETRY column, insert a row in USER_SDO_GEOM_METADATA The spatial indexing routines require you to populate a table that contains metadata about SDO_GEOMETRY columns The metadata is created under the Oracle user that owns the geometry The metadata view is called USER_SDO_GEOM_METADATA For every SDO_GEOMETRY column, insert a row in USER_SDO_GEOM_METADATA

46 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200046 SDO_GEOM_METADATA Views SDO_GEOM_METADATA table has 3 system views: –user_sdo_geom_metadata –all_sdo_geom_metadata –dba_sdo_geom_metadata SDO_GEOM_METADATA table has 3 system views: –user_sdo_geom_metadata –all_sdo_geom_metadata –dba_sdo_geom_metadata SQL> INSERT INTO user_sdo_geom_metadata (table_name, column_name, diminfo, srid) values ( ‘ROADS’, ‘GEOMETRY’, mdsys.sdo_dim_array ( mdsys.sdo_dim_element (‘X’,-180,180,.005), mdsys.sdo_dim_element (‘Y’,-90,90,.005)), NULL); SQL> INSERT INTO user_sdo_geom_metadata (table_name, column_name, diminfo, srid) values ( ‘ROADS’, ‘GEOMETRY’, mdsys.sdo_dim_array ( mdsys.sdo_dim_element (‘X’,-180,180,.005), mdsys.sdo_dim_element (‘Y’,-90,90,.005)), NULL);

47 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200047 CREATE INDEX ON ( ) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ( ‘SDO_LEVEL =, [SDO_NUMTILES = ], [SDO_COMMIT_INTERVAL = ], [ = ]’ ); CREATE INDEX ON ( ) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS ( ‘SDO_LEVEL =, [SDO_NUMTILES = ], [SDO_COMMIT_INTERVAL = ], [ = ]’ );

48 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200048 ALTER INDEX ALTER INDEX RENAME TO ALTER INDEX REBUILD PARAMETERS ( ); ALTER INDEX REBUILD PARAMETERS ( ); ALTER INDEX PARAMETERS ( ); ALTER INDEX PARAMETERS ( );

49 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200049 DROP INDEX Drops all index tables associated with a column of type SDO_GEOMETRY If a CREATE INDEX on a column of type SDO_GEOMETRY does not successfully complete, you must call DROP INDEX using the FORCE option. DROP INDEX FORCE;

50 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200050 Spatial Operators vs Functions Spatial operators:Spatial operators: –Take advantage of spatial indexes –Require that spatial index exists on the first geometry specified in the operator. Spatial Functions: Spatial Functions: –Do not take advantage of spatial indexes –Could be used on small tables that are not spatially indexed Spatial operators:Spatial operators: –Take advantage of spatial indexes –Require that spatial index exists on the first geometry specified in the operator. Spatial Functions: Spatial Functions: –Do not take advantage of spatial indexes –Could be used on small tables that are not spatially indexed

51 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200051 Spatial Operators vs Functions SDO_RELATE –Performs a primary and secondary filter SDO_FILTER –Performs a primary filter only SDO_WITHIN_DISTANCE –Generates a buffer around a geometry and performs a primary and optionally a secondary filter SDO_RELATE –Performs a primary and secondary filter SDO_FILTER –Performs a primary filter only SDO_WITHIN_DISTANCE –Generates a buffer around a geometry and performs a primary and optionally a secondary filter SDO_GEOM.RELATE –To determine the relationship between two geometries –To perform a spatial query without using a spatial index (I.e. on a small table) SDO_GEOM.WITHIN_DISTANCE –Generates a buffer around a geometry and performs a secondary filter OperatorsFunctions

52 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200052 select c.city, c.pop90 from cities c where mdsys.sdo_filter ( c.location, mdsys.sdo_geometry (3, null, null, mdsys.sdo_elem_info_array (1,3,3), mdsys.sdo_ordinate_array (-109,37,-102,40)), ‘querytype=WINDOW’) = 'TRUE'; select c.city, c.pop90 from cities c where mdsys.sdo_filter ( c.location, mdsys.sdo_geometry (3, null, null, mdsys.sdo_elem_info_array (1,3,3), mdsys.sdo_ordinate_array (-109,37,-102,40)), ‘querytype=WINDOW’) = 'TRUE'; SDO_FILTER Example Find all cities in a selected rectangular area Result is approximate Find all cities in a selected rectangular area Result is approximate

53 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200053 A B A B A B A B A B A red B green A B Inside Contains Covers Covered by Touch Overlap Boundaries Intersect Overlap Boundaries Disjoint Equal Disjoint Spatial (topological) relationships

54 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200054 select c.county, c.state_abrv from counties c, states s where s.state = 'New Hampshire' and mdsys.sdo_relate (c.geom, s.geom, 'mask=INSIDE+COVEREDBY querytype=WINDOW') = 'TRUE'; select c.county, c.state_abrv from counties c, states s where s.state = 'New Hampshire' and mdsys.sdo_relate (c.geom, s.geom, 'mask=INSIDE+COVEREDBY querytype=WINDOW') = 'TRUE'; SDO_RELATE - A window query Find all counties in the state of New Hampshire

55 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200055 select c.city, c.pop90 from cities c where mdsys.sdo_relate ( c.location, mdsys.sdo_geometry (3, null, null, mdsys.sdo_elem_info_array (1,3,3), mdsys.sdo_ordinate_array (-109,37,-102,40)), 'mask=ANYINTERACT querytype=WINDOW') =‘TRUE’; select c.city, c.pop90 from cities c where mdsys.sdo_relate ( c.location, mdsys.sdo_geometry (3, null, null, mdsys.sdo_elem_info_array (1,3,3), mdsys.sdo_ordinate_array (-109,37,-102,40)), 'mask=ANYINTERACT querytype=WINDOW') =‘TRUE’; SDO_RELATE - A window query Find all cities in a selected rectangular area

56 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200056 Find all cities within a distance from an interstate Find intersates within a distance from a city Find all cities within a distance from an interstate Find intersates within a distance from a city select c.city from cities c, interstates i where interstate = ‘I175’ and mdsys.sdo_within_distance ( c.location, i.geom, ‘distance=0.5') = 'TRUE'; select c.city from cities c, interstates i where interstate = ‘I175’ and mdsys.sdo_within_distance ( c.location, i.geom, ‘distance=0.5') = 'TRUE'; SDO_WITHIN_DISTANCE Examples select i.interstate from interstates i, cities c where city = 'Tampa' and mdsys.sdo_within_distance ( i.geom, c.location,'distance=0.5') = 'TRUE'; select i.interstate from interstates i, cities c where city = 'Tampa' and mdsys.sdo_within_distance ( i.geom, c.location,'distance=0.5') = 'TRUE';

57 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200057 SDO_GEOM.RELATE Function select c.county, mdsys.sdo_geom.relate (s.geom,, 'determine', c.geom, ) from states s, counties c where s.state = 'New Jersey' and s.state = c.state; COUNTY RELATIONSHIP ------------------------------- -------------- Atlantic COVERS Cape May COVERS Cumberland COVERS Essex CONTAINS select c.county, mdsys.sdo_geom.relate (s.geom,, 'determine', c.geom, ) from states s, counties c where s.state = 'New Jersey' and s.state = c.state; COUNTY RELATIONSHIP ------------------------------- -------------- Atlantic COVERS Cape May COVERS Cumberland COVERS Essex CONTAINS Note: this is simplified syntax Determine relationship of counties and states

58 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200058 Summary Extensibility framework – –Interoperability of Domains – –Better Optimization Opportunities – –Uniform easy SQL access Oracle Spatial – –Mainstream Spatial data management – –Open SQL access to spatial data – –Support business geographics as well as GIS Extensibility framework – –Interoperability of Domains – –Better Optimization Opportunities – –Uniform easy SQL access Oracle Spatial – –Mainstream Spatial data management – –Open SQL access to spatial data – –Support business geographics as well as GIS

59 Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 200059 Jayant Sharma, Ph.D. Consulting Member Technical Staff Spatial Products Server Technologies Phone : (603) 897 - 3187 Jayant.Sharma@oracle.com Oracle Corporation ® One Oracle Drive Nashua, NH 03062


Download ppt "Copyright  Oracle Corporation, 2000. All rights reserved. GeoInfo June 13, 20001 Oracle 8i Extensibility & Spatial Presented By: Jayant Sharma"

Similar presentations


Ads by Google