Oracle spatial – Creating spatial tables Object Relational Model Creating Spatial Tables.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Chapter 22 Implementing lists: linked implementations.
Chapter 4 Joining Multiple Tables
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Introdução to Geoinformatics: Geometries. Vector Model Lines: fundamental spatial data model Lines start and end at nodes line #1 goes from node #2 to.
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
Object Relational Model Spatial Queries. Query Model Spatial Layer Data Table where coordinates are stored Primary Filter Spatial Index Index retrieves.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Lecture 05: Spatial Data Structure for Computer Cartography Geography 128 Analytical and Computer Cartography Spring 2007 Department of Geography University.
CSE 190: Internet E-Commerce Lecture 10: Data Tier.
Oracle8i Spatial Concepts. Concepts Geometric data types Oracle8i Spatial data model Spatial Layers Spatial query model Spatial indexing «Window» queries.
Spatial Information Systems (SIS) COMP Spatial access methods: Indexing.
Geographic Information Systems
LIS 557 Database Design and Management William Voon Michael Cole Spring '04.
Oracle Location based services Spatial and Oracle Locator Srinivas Gudelli CIS 764 Fall 2008.
TECNOLOGIAS DE ARMAZENAMENTO DE INFORMAÇÃO ESPACIAL.
Database Systems More SQL Database Design -- More SQL1.
Object Relational Model Spatial Queries. Query Model Spatial Layer Data Table where coordinates are stored Primary Filter Spatial Index Index retrieves.
Object Relational Model Creating Spatial Tables. Concepts Describe the schema associated with a spatial layer Explain how spatial data is stored using.
Inner join, self join and Outer join Sen Zhang. Joining data together is one of the most significant strengths of a relational database. A join is a query.
Introduction to Oracle Spatial
Overview Classes of datatypes available in Oracle 10g – Character – Numeric – Long, Raw – Dates/Times – Large Objects (LOBs) – ROWID – Specialized 1.
JTS Topology Suite JTS Topology Suite An API for Processing Linear Geometry Martin Davis, Senior Technical Architect
Spatial Data Models. What is a Data Model? What is a model? (Dictionary meaning) A set of plans (blueprint drawing) for a building A miniature representation.
Spatial Database Souhad Daraghma.
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Applied Cartography and Introduction to GIS GEOG 2017 EL
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Location Based features of the Oracle RDBMS plus Some interesting new features of Oracle9i - Flashback - Fine Graind Audit - Workspace Management by Martin.
Applied Cartography and Introduction to GIS GEOG 2017 EL Lecture-2 Chapters 3 and 4.
Copyright  Oracle Corporation, All rights reserved. GeoInfo June 13, Oracle 8i Extensibility & Spatial Presented By: Jayant Sharma
 Trace the incremental algorithm for constructing convex data on the sample point data given below. Intermediate steps should be shown First, two steps.
6. Simple Features Specification Background information UML overview Simple features geometry.
How to Spatially Enable Your IBM Informix Database Chris Bosch.
1 Data models Vector data model Raster data model.
SQL access and working with ST_Geometry Functions
1 1 W. Fredrick Limp University Professor Robert Harris DBA Center for Advanced Spatial Technologies University of Arkansas Spatially Enabling the DBMS.
Chapter 4Introduction to Oracle9i: SQL1 Chapter 4 Joining Multiple Tables.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
Collections Oracle Database PL/SQL 10g Programming Chapter 6.
PostGIS and Spatial Queries Steve Signell, Instructor Robert Poirier, TA School of Science Rensselaer Polytechnic Institute.
C-Store: Data Model and Data Organization Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY May 17, 2010.
Spatial DBMS Spatial Database Management Systems.
Query and Reasoning. Types of Queries Most GIS queries will select spatial features Query by Attribute (Select by Attribute) –Structured Query Language.
John Pickford IBM H11 Wednesday, October 4, :30. – 14:30. Platform: Informix Practical Applications of IDS Extensibility (Part 2 of 2)
Benjamin Post Cole Kelleher.  Availability  Data must maintain a specified level of availability to the users  Performance  Database requests must.
CMPT 258 Database Systems Relational Algebra (Chapter 4)
Kedar Gawande Position Paper ITK 478 Fall / 04 / 2006.
U.S. Census Data & TIGER/Line Files
Descriptive Geometry. Introduction  What is Descriptive Geometry? →It is the study of points, lines, and planes in space to determine their locations.
Lecture 3: Spatial Data Management Dr. Taysir Hassan Abdel Hamid Associate Professor, Information Systems Dept., Faculty of Computers and Information.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Oracle Spatial Extension of the RDBMS Oracle by spatial data types and operations –introduced in version 8 (current version.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
More SQL: Complex Queries,
Module 11: File Structure
Relational Database Design
Physical Structure of GDB
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Geographic Information Systems
Relational Algebra Chapter 4, Part A
Introdução to Geoinformatics: vector geometries
JTS Topology Suite An API for Processing Linear Geometry
More SQL: Complex Queries, Triggers, Views, and Schema Modification
GTECH 709 Spatial relationships
Spatial and temporal data management
SQL DATA CONSTRAINTS.
Introduction to Geoinformatics: Topology
Presentation transcript:

Oracle spatial – Creating spatial tables Object Relational Model Creating Spatial Tables

Oracle spatial – Creating spatial tables Concepts Describe the schema associated with a spatial layer Explain how spatial data is stored using the Oracle8i Spatial object-relational model Create the table associated with a spatial layer Describe the schema associated with a spatial layer Explain how spatial data is stored using the Oracle8i Spatial object-relational model Create the table associated with a spatial layer

Oracle spatial – Creating spatial tables SDO_GEOMETRY Object SQL> CREATE TABLE states ( 2 state VARCHAR2(30), 3 totpop NUMBER(9), 4 geom MDSYS.SDO_GEOMETRY); SQL> CREATE TABLE states ( 2 state VARCHAR2(30), 3 totpop NUMBER(9), 4 geom MDSYS.SDO_GEOMETRY); Example sdo_gtype NUMBER sdo_srid NUMBER sdo_point SDO_POINT_TYPE sdo_elem_info SDO_ELEM_INFO_ARRAY sdo_ordinates SDO_ORDINATE_ARRAY sdo_gtype NUMBER sdo_srid NUMBER sdo_point SDO_POINT_TYPE sdo_elem_info SDO_ELEM_INFO_ARRAY sdo_ordinates SDO_ORDINATE_ARRAY SDO_GEOMETRY Object

Oracle spatial – Creating spatial tables SDO_GEOMETRY Object (cont.) x NUMBER y NUMBER z NUMBER x NUMBER y NUMBER z NUMBER SDO_POINT_TYPE VARRAY ( ) OF NUMBER SDO_ORDINATE_ARRAY SDO_ELEM_INFO_ARRAY

Oracle spatial – Creating spatial tables SDO_GTYPE Defines the kind of geometry stored in the object d = number of dimensions e.g. 2, 3 or 4 Defines the kind of geometry stored in the object d = number of dimensions e.g. 2, 3 or 4 GTYPEExplanation d000 UNKNOWN_GEOMETRYSpatial ignores this geometry. d001 POINT Geometry contains one point. d002 LINESTRINGGeometry contains one line string. d003 POLYGON Geometry contains one polygon. d004 HETEROGENEOUS COLLECTIONGeometry is a collection of elements of different types: points, lines, polygons d005 MULTIPOINTGeometry has multiple points. d006 MULTILINESTRINGGeometry has multiple line strings. d007 MULTIPOLYGON Geometry has multiple polygons

Oracle spatial – Creating spatial tables SDO_SRID Defines the coordinate system («Spatial Reference System») used for this geometry Integer value matching a Spatial Reference Id defined in the MDSYS.CS_SRS table If not specified, use the spatial reference system defined at layer level (in spatial metadata) - if any Defines the coordinate system («Spatial Reference System») used for this geometry Integer value matching a Spatial Reference Id defined in the MDSYS.CS_SRS table If not specified, use the spatial reference system defined at layer level (in spatial metadata) - if any

Oracle spatial – Creating spatial tables SDO_POINT This type should not be used outside of the SDO_GEOMETRY object. Optimized space for storing points (not point clusters). Ignored if SDO_ELEM_INFO and SDO_ORDINATES are not NULL This type should not be used outside of the SDO_GEOMETRY object. Optimized space for storing points (not point clusters). Ignored if SDO_ELEM_INFO and SDO_ORDINATES are not NULL

Oracle spatial – Creating spatial tables SDO_ELEM_INFO Entries in the array should be considered in groups of three. The triplet values stored in the this array are interpreted as: –Ordinate offset - The position of the first ordinate of an element in the sdo_ordinates array. Values start at 1. –Element type –Interpretation - Straight line, Circular arc or header Entries in the array should be considered in groups of three. The triplet values stored in the this array are interpreted as: –Ordinate offset - The position of the first ordinate of an element in the sdo_ordinates array. Values start at 1. –Element type –Interpretation - Straight line, Circular arc or header

Oracle spatial – Creating spatial tables SDO_ORDINATES This is a simple array of numbers Contains the ordinates that make up geometry elements Elements stored in the SDO_ORDINATES array are defined in the SDO_ELEM_INFO array This is a simple array of numbers Contains the ordinates that make up geometry elements Elements stored in the SDO_ORDINATES array are defined in the SDO_ELEM_INFO array

Oracle spatial – Creating spatial tables Element Example: Point Point optimized for space Spatial index is 2 dimensional, x and y. To generate a spatial index on SDO_POINT, SDO_ELEM_INFO and SDO_ORDINATES must be NULL. Point optimized for space Spatial index is 2 dimensional, x and y. To generate a spatial index on SDO_POINT, SDO_ELEM_INFO and SDO_ORDINATES must be NULL. (x, y, z) SQL> INSERT INTO telephone_poles 2> VALUES (attribute_1, …. attribute_n, 3> mdsys.sdo_geometry ( 4> 3001, null, 5> mdsys.sdo_point_type (43.7,-75.2,200), 6> null, null) 7> ); SQL> INSERT INTO telephone_poles 2> VALUES (attribute_1, …. attribute_n, 3> mdsys.sdo_geometry ( 4> 3001, null, 5> mdsys.sdo_point_type (43.7,-75.2,200), 6> null, null) 7> );

Oracle spatial – Creating spatial tables Element Types in SDO_ELEM_INFO Element TypesInterpretation 0 UNKNOWN_ELEMENT 1 POINT # of points in collection 2 LINESTRING 1 - Straight lines 2 - Circular arcs n003 POLYGON 1 - Straight lines 2 - Circular arcs 3 - Optimized rectangle 4 - Circle 4 COMPOUND LINESTRING# of type 2 sub-elements that make up the linestring n005 COMPOUND POLYGON # of type 2 sub-elements that make up the polygon

Oracle spatial – Creating spatial tables Element Example: Line String Ordinate offset 1 Element type 2 Interpretation 1 (x1,y1)(x1,y1) (x2,y2)(x2,y2) (x3,y3)(x3,y3) (x4,y4)(x4,y4) Line segments that close to form a ring have no implied interior Line segments must be contiguous Line segments that close to form a ring have no implied interior Line segments must be contiguous

Oracle spatial – Creating spatial tables Element Example: Arc String Ordinate offset 1 Element type 2 Interpretation 2 (x7,y7) (x1,y1) (x3,y3)(x3,y3) (x4,y4) (x2,y2) (x5,y5) (x6,y6) Each arc is defined by three points on the circumference of a circle Last point from one arc is the first point of next arc Arcs that close to form a ring have no implied interior Arcs must be contiguous Each arc is defined by three points on the circumference of a circle Last point from one arc is the first point of next arc Arcs that close to form a ring have no implied interior Arcs must be contiguous

Oracle spatial – Creating spatial tables Element Example: Polygon Interpretation 1 - All line segments are straight lines Area is implied Line segments cannot cross each other Interpretation 1 - All line segments are straight lines Area is implied Line segments cannot cross each other Ordinate offset 1 Element type 1003 Interpretation 1 (x4,y4)(x4,y4) (x5,y5) (x3,y3) (x2,y2) (x6,y6)(x1,y1)

Oracle spatial – Creating spatial tables In this lecture See more examples of possible geometries in Oracle Spatial Encoding polygons Constructing geometries Metadata Topology in Oracle Spatial See more examples of possible geometries in Oracle Spatial Encoding polygons Constructing geometries Metadata Topology in Oracle Spatial

Oracle spatial – Creating spatial tables Element Example: Arc Polygon (x8,y8) Interpretation 2 - All line segments are circular arcs Area is implied Arcs can not cross each other Interpretation 2 - All line segments are circular arcs Area is implied Arcs can not cross each other Ordinate offset 1 Element type 1003 Interpretation 2 (x7,y7)(x7,y7) (x8,y8) (x6,y6) (x5,y5) (x9,y9) (x2,y2) (x3,y3) (x4,y4) (x1,y1)

Oracle spatial – Creating spatial tables Element Example: Rectangle Optimal storage - Defined by lower left point, upper right point Area is implied Optimal storage - Defined by lower left point, upper right point Area is implied Ordinate offset 1 Element type 1003 Interpretation 3 (x2,y2) (x1,y1)

Oracle spatial – Creating spatial tables Element Example: Circle Defined by any three points on the circumference Area is implied Defined by any three points on the circumference Area is implied Ordinate Offset 1 Element Type 1003 Interpretation 4 (x1,y1)(x1,y1) (x2,y2) (x3,y3)

Oracle spatial – Creating spatial tables Element Example: Compound Line String First triplet (header) defines the number of sub-elements Sub-elements must be contiguous Arcs and line segments of sub-elements can cross Element types 4 can ONLY contain element types 2 First triplet (header) defines the number of sub-elements Sub-elements must be contiguous Arcs and line segments of sub-elements can cross Element types 4 can ONLY contain element types 2 (x6,y6) Element Type 4 2 Ordinate Offset (x3,y3) (x1,y1) (x5,y5) (x4,y4) (x2,y2) (x7,y7) (x8,y8) (x9,y9) Interpretation

Oracle spatial – Creating spatial tables Element Example: Compound Polygon First triplet (header) defines the number of sub-elements Sub-elements must be contiguous Arcs and line segments of sub-elements can cross Element types 5 can ONLY contain element types 2 Area is implied First triplet (header) defines the number of sub-elements Sub-elements must be contiguous Arcs and line segments of sub-elements can cross Element types 5 can ONLY contain element types 2 Area is implied Interpretation Element Type Ordinate Offset 1 5 (x4,y4) (x5,y5) (x6,y6) (x7,y7) (x2,y2) (x3,y3) (x1,y1)

Oracle spatial – Creating spatial tables Element Example: Unknown geometry Element type 0 is ignored by Oracle Spatial Element type 0 is for modeling unsupported element types (I.e. curves, splines etc…) A geometry with an element type 0 must contain at least one element of type 1,2,3,4 or 5. The non 0 element is an approximation of the unsupported geometry. The approximation is indexed by Oracle Spatial Element type 0 is ignored by Oracle Spatial Element type 0 is for modeling unsupported element types (I.e. curves, splines etc…) A geometry with an element type 0 must contain at least one element of type 1,2,3,4 or 5. The non 0 element is an approximation of the unsupported geometry. The approximation is indexed by Oracle Spatial Ordinate Offset 1 11 Element Type Interpretation (x1,y1) (x2,y2) (x3,y3) (x4,y4) (x5,y5) (x6,y6) (x7,y7)

Oracle spatial – Creating spatial tables Collection Example: Point cluster Ordinate Offset 1 Element type 1 Interpretation 5 (x3,y3) (x5,y5) (x2,y2) (x4,y4) (x1,y1) Interpretation is the number of points in the cluster

Oracle spatial – Creating spatial tables Collection Example: Multi Line String Elements can be line strings, arc strings or compound line strings (x1,y1)(x1,y1) (x2,y2)(x2,y2) (x3,y3)(x3,y3) (x4,y4)(x4,y4)(x6,y6)(x6,y6) Ordinate offset 1 7 Element type 2 Interpretation 1 2 (x5,y5)(x5,y5)

Oracle spatial – Creating spatial tables Collection Example: Multi Polygon Elements can be polygons, arcs polygons, or compound polygons Ordinate offset 1 13 Element type 1003 Interpretation 1 4 (x4,y4)(x4,y4) (x5,y5) (x3,y3) (x2,y2) (x6,y6)(x1,y1) (x7,y7)(x7,y7) (x8,y8) (x9,y9)

Oracle spatial – Creating spatial tables Element example: Polygon with void A void can be modeled with any combination of type 3 and type 5 elements Voids can contain islands and islands can contain voids Area is implied as the difference between the outer and inner polygons A void can be modeled with any combination of type 3 and type 5 elements Voids can contain islands and islands can contain voids Area is implied as the difference between the outer and inner polygons (x4,y4)(x4,y4) (x5,y5) (x3,y3) (x2,y2) (x6,y6) (x1,y1) (x7,y7) (x8,y8) Ordinate offset 1 13 Element type Interpretation 1 3

Oracle spatial – Creating spatial tables Element example: Compound polygon with void A void can be modeled with any combination of type 3 and type 5 elements Voids can contain islands and islands can contain voids Area is implied as the difference between the outer and inner polygons A void can be modeled with any combination of type 3 and type 5 elements Voids can contain islands and islands can contain voids Area is implied as the difference between the outer and inner polygons Interpretation Ordinate Offset Element Type (x5,y5) (x4,y4) (x3,y3) (x6,y6) (x7,y7) (x1,y1) (x2,y2) (x9,y9) (x10,y10) (x8,y8)

Oracle spatial – Creating spatial tables Encoding polygons with voids Note: Order required for boundaries Orientation of coordinates: Note: Order required for boundaries Orientation of coordinates: is different from AB DE CF AF DC EB Not the same as + +

Oracle spatial – Creating spatial tables Ring ordering External ring must appear before internal ring Outer and inner rings identified by element type External ring must appear before internal ring Outer and inner rings identified by element type must be constructed as

Oracle spatial – Creating spatial tables Points orientation Counter-clockwise for exterior rings Clockwise for interior rings Counter-clockwise for exterior rings Clockwise for interior rings AB DE CF + AB ED CF

Oracle spatial – Creating spatial tables Constructing geometries (10,10)(10,10) (20,25)(20,25) (30,10)(30,10) (40,10)(40,10) SQL> INSERT INTO lines VALUES ( 2> attribute_1, …. attribute_n, 3> mdsys.sdo_geometry ( 4> 2002, null, null, 5> mdsys.sdo_elem_info_array (1,2,1), 6> mdsys.sdo_ordinate_array ( 7> 10,10, 20,25, 30,10, 40,10)) 8> ); SQL> INSERT INTO lines VALUES ( 2> attribute_1, …. attribute_n, 3> mdsys.sdo_geometry ( 4> 2002, null, null, 5> mdsys.sdo_elem_info_array (1,2,1), 6> mdsys.sdo_ordinate_array ( 7> 10,10, 20,25, 30,10, 40,10)) 8> );

Oracle spatial – Creating spatial tables Constructing geometries SQL> INSERT INTO PARKS VALUES( 2> attribute_1, …, attribute_n, 3> MDSYS.SDO_GEOMETRY( 4> 2003, null, null, 5> MDSYS.SDO_ELEM_INFO_ARRAY 6> (1,1005,2, 1,2,1, 7,2,2, 17,2003,3), 7> MDSYS.SDO_ORDINATE_ARRAY 8> (10,50,10,30,50,30,50,50,40,60, 9> 30,50,20,60,10,50,25,35,35,40 )); SQL> INSERT INTO PARKS VALUES( 2> attribute_1, …, attribute_n, 3> MDSYS.SDO_GEOMETRY( 4> 2003, null, null, 5> MDSYS.SDO_ELEM_INFO_ARRAY 6> (1,1005,2, 1,2,1, 7,2,2, 17,2003,3), 7> MDSYS.SDO_ORDINATE_ARRAY 8> (10,50,10,30,50,30,50,50,40,60, 9> 30,50,20,60,10,50,25,35,35,40 )); (x5,y5) (x4,y4) (x3,y3) (x6,y6) (x7,y7) (x1,y1) (x2,y2) (x9,y9) (x10,y10) (x8,y8)

Oracle spatial – Creating spatial tables Element Types Summarized Element TypesInterpretation 0 UNKNOWN_ELEMENT 1 POINT # of points in collection 2 LINESTRING 1 - Straight lines 2 - Circular arcs 3 POLYGON 1 - Straight lines 2 - Circular arcs 3 - Optimized rectangle 4 - Circle 4 COMPLEX LINESTRING# of type 2 elements that make up the linestring 5 COMPLEX POLYGON # of type 2 elements that make up the polygon

Oracle spatial – Creating spatial tables Spatial Metadata The spatial routines require you to populate a table that contains metadata about SDO_GEOMETRY columns The metadata table is created under the Oracle user MDSYS during installation The metadata table is referenced via the view USER_SDO_GEOM_METADATA For every SDO_GEOMETRY column, insert a row in the USER_SDO_GEOM_METADATA view The spatial routines require you to populate a table that contains metadata about SDO_GEOMETRY columns The metadata table is created under the Oracle user MDSYS during installation The metadata table is referenced via the view USER_SDO_GEOM_METADATA For every SDO_GEOMETRY column, insert a row in the USER_SDO_GEOM_METADATA view

Oracle spatial – Creating spatial tables USER_SDO_GEOM_METADATA sdo_dimname VARCHAR2(32) sdo_lb NUMBER sdo_ub NUMBER sdo_tolerance NUMBER sdo_dimname VARCHAR2(32) sdo_lb NUMBER sdo_ub NUMBER sdo_tolerance NUMBER MDSYS.SDO_DIM_ELEMENT object VARRAY(4) OF SDO_DIM_ELEMENT MDSYS.SDO_DIM_ARRAY table_name VARCHAR2(32), column_name VARCHAR2(32), diminfo MDSYS.SDO_DIM_ARRAY srid NUMBER table_name VARCHAR2(32), column_name VARCHAR2(32), diminfo MDSYS.SDO_DIM_ARRAY srid NUMBER USER_SDO_GEOM_METADATA

Oracle spatial – Creating spatial tables USER_SDO_GEOM_METADATA (cont.) SDO_DIMNAME –The dimension name SDO_LB –Lowest possible value for this dimension SDO_UB –Largest possible value for this dimension SDO_TOLERANCE –Round-off error value used by Oracle Spatial indexing, operators and functions. SDO_SRID –Spatial Reference System id (optional) SDO_DIMNAME –The dimension name SDO_LB –Lowest possible value for this dimension SDO_UB –Largest possible value for this dimension SDO_TOLERANCE –Round-off error value used by Oracle Spatial indexing, operators and functions. SDO_SRID –Spatial Reference System id (optional)

Oracle spatial – Creating spatial tables Populating USER_SDO_GEOM_METADATA SQL> INSERT INTO USER_SDO_GEOM_METADATA VALUES 2 (‘ROADS’, 3 ‘GEOMETRY’, 4 MDSYS.SDO_DIM_ARRAY ( 5 MDSYS.SDO_DIM_ELEMENT(’Long’, -180, 180,.005), 6 MDSYS.SDO_DIM_ELEMENT(‘Lat’, -90, 90,.005) 7 ), 8 NULL 9 ); SQL> INSERT INTO USER_SDO_GEOM_METADATA VALUES 2 (‘ROADS’, 3 ‘GEOMETRY’, 4 MDSYS.SDO_DIM_ARRAY ( 5 MDSYS.SDO_DIM_ELEMENT(’Long’, -180, 180,.005), 6 MDSYS.SDO_DIM_ELEMENT(‘Lat’, -90, 90,.005) 7 ), 8 NULL 9 );

Oracle spatial – Creating spatial tables Notes on dimensions You can place more than 2 dimensions in the SDO_DIM_ARRAY, but Oracle Spatial Operators, Functions and Indexing will only use the first 2 dimensions defined. All layers that you want to match MUST have the EXACT SAME bounds ! You can place more than 2 dimensions in the SDO_DIM_ARRAY, but Oracle Spatial Operators, Functions and Indexing will only use the first 2 dimensions defined. All layers that you want to match MUST have the EXACT SAME bounds !

Oracle spatial – Creating spatial tables Support for topology Topology is not explicitly maintained in the DB Several topological operators and functions have been implemented for checking the relationships between two geometries Window and spatial join queries are also supported Topology is not explicitly maintained in the DB Several topological operators and functions have been implemented for checking the relationships between two geometries Window and spatial join queries are also supported

Oracle spatial – Creating spatial tables A B A B A B A B A B A red B green A B B Inside A A Contains B B Covered by A A Covers B Touch Overlap Boundaries Intersect Overlap Boundaries Disjoint Equal Disjoint Topological relationships

Oracle spatial – Creating spatial tables 1.DISJOINT: boundaries and interiors do not intersect 2. TOUCH: boundaries intersect but interiors do not intersect 3. OVERLAPBDYDISJOINT: interior of one object intersects boundary and interior of other object, but two boundaries do not intersect (example: a line originates outside a polygon and ends inside the polygon) 4. OVERLAPBDYINTERSECT: boundaries and interiors of the two objects intersect 5. EQUAL: the two objects have the same boundary and interior Topological relationships

Oracle spatial – Creating spatial tables 6. CONTAINS: interior and boundary of one object is completely contained in the interior of other object 7. COVERS: interior of one object is completely contained in interior of other object and their boundaries intersect 8. INSIDE: opposite of CONTAINS; A INSIDE B implies B CONTAINS A 9. COVEREDBY: opposite of COVERS; A COVEREDBY B implies B COVERS A 10. ANYINTERACT: the objects are non-disjoint Topological relationships (cont.d)

Oracle spatial – Creating spatial tables SDO_RELATE MASK: identifies the topological relation Topological operators: SDO_RELATE boolean := SDO_RELATE (,, ‘MASK= QUERYTYPE= [other optional parameters]’ ) boolean := SDO_RELATE (,, ‘MASK= QUERYTYPE= [other optional parameters]’ )

Oracle spatial – Creating spatial tables Summary Oracle Spatial data model: elements, geometries and layers SDO_GEOMETRY object type Constructing geometries Associated Metadata Support for Topology Oracle Spatial data model: elements, geometries and layers SDO_GEOMETRY object type Constructing geometries Associated Metadata Support for Topology