introduction to oracle spatial

60
Introductio n to Oracle Spatial EHSAN HAMZEI DECEMBER, 2016

Upload: ehsan-hamzei

Post on 12-Apr-2017

90 views

Category:

Engineering


12 download

TRANSCRIPT

Page 1: Introduction to Oracle Spatial

Introduction to Oracle SpatialEHSAN HAMZEIDECEMBER, 2016

Page 2: Introduction to Oracle Spatial

Oracle Spatial??

Oracle Spatial Technology Products : Storage data model using the

SDO_GEOMETRY data type Query and analysis using the Index Engine and

Geometry Engine Location-enabling using the geocoder by

converting address data into SDO_GEOMETRY data

Visualization using Map Viewer and Oracle Maps

Advanced Spatial Engine functionality such as network analysis and routing

Page 3: Introduction to Oracle Spatial

Oracle Spatial Architecture

Page 4: Introduction to Oracle Spatial

SDO_GEOMETRY

Spatial Data Type in Oracle DB How To Create a Table with Spatial Column??

Page 5: Introduction to Oracle Spatial

SDO_GEOMETRY

What is a Geometry Data??

Page 6: Introduction to Oracle Spatial

SDO_GEOMETRY

SDO Geometry Data Type: SDO_G-Type SDO_SRID SDO_POINTS SDO_ELEM_INFO_ARRAY SDO_ORDINATE_ARRAY

Page 7: Introduction to Oracle Spatial

SDO_GEOMETRY: G-TYPE

attribute specifies the type of shape (point, line, polygon, collection, multi-point, multi-line, or multi-polygon) that the geometry actually represents.

D00T Example: 2003, 2001,3006

Page 8: Introduction to Oracle Spatial

SDO_GEOMETRY: SRID

This attribute specifies the spatial reference system, or coordinate system, for the geometry.

Geo-referenced vs. Local Coordinates! Geodetic vs. Projected? (WGS84, UTM-Z39N) European Petroleum Standards Group

(EPSG) Example: 4326 (WGS84),

Page 9: Introduction to Oracle Spatial

SDO_POINTS

Its just a syntactic sugar!! This attribute specifies the location of a point

geometry

Example:

Page 10: Introduction to Oracle Spatial

SDO_ELEM_INFO

Page 11: Introduction to Oracle Spatial

SDO_ELEM_INFO

Page 12: Introduction to Oracle Spatial

SDO_ELEM_INFO

Page 13: Introduction to Oracle Spatial

SDO_ORDINATE

Insert Coordinate Based on provided ElEM_INFO Example:

Page 14: Introduction to Oracle Spatial

SDO_ORDINATE

Insert Coordinate Based on provided ElEM_INFO Example:

Page 15: Introduction to Oracle Spatial

SDO_ORDINATE

Insert Coordinate Based on provided ElEM_INFO Example:

Page 16: Introduction to Oracle Spatial

SDO_ORDINATE

Insert Coordinate Based on provided ElEM_INFO Example:

Page 17: Introduction to Oracle Spatial

SDO_ORDINATE

Insert Coordinate Based on provided ElEM_INFO Example:

Page 18: Introduction to Oracle Spatial

SDO_ORDINATE

Insert Coordinate Based on provided ElEM_INFO Example:

Page 19: Introduction to Oracle Spatial

Complex Geometry

Page 20: Introduction to Oracle Spatial

Complex Geometry

Page 21: Introduction to Oracle Spatial

Complex Geometry

Page 22: Introduction to Oracle Spatial

Complex Geometry

Page 23: Introduction to Oracle Spatial

Complex Geometry

Page 24: Introduction to Oracle Spatial

Collections

Page 25: Introduction to Oracle Spatial

Collections

Page 26: Introduction to Oracle Spatial

Collections

Page 27: Introduction to Oracle Spatial

Collections

Creating Collections: The Easy Way :For NON-OVERLAPPING geometries!!!

Page 28: Introduction to Oracle Spatial

CollectionsMore Sophisticated Examples!!

Page 29: Introduction to Oracle Spatial

Spatial Operators!

Spatial operators: Just as you can specify relational operators in a

SQL statement, such as“< (less than), > (greater than), or = (equal to), and so on”, you can likewise use a spatial operator to search the location (SDO_GEOMETRY) columns of a table for proximity with respect to a query location

Need Spatial Index First !!!

Page 30: Introduction to Oracle Spatial

Spatial Index!

Create Spatial Index

Need Spatial Meta Data First!!!

Page 31: Introduction to Oracle Spatial

Spatial Meta Data Table

USER_SDO_GEOM_METADATA

DIM INFO >> INFORMATION ABOUT: SDO_DIM_ELEMENT

DIM_NAME MIN/MAX DATA TOLERANCE

Page 32: Introduction to Oracle Spatial

Spatial Meta Data Table

INSERTION EXAMPLE:

Page 33: Introduction to Oracle Spatial

REVIEW

FIRST>> CREATE TABLE THEN>> INSERT METADATA NEXT>> CREATE SPATIAL INDEX FINALLY>> INSERT DATA AND QUERY FROM THE

TABLE

Page 34: Introduction to Oracle Spatial

SPATIAL OPERATORS

GENERAL SYNTAX:

EXAMPLE:

Page 35: Introduction to Oracle Spatial

SPATIAL OPERATORS

Page 36: Introduction to Oracle Spatial

SDO_WITHIN_DISTANCE Operator

Concept:

Syntax:

Example:

Page 37: Introduction to Oracle Spatial

SDO_NN Operator

Concept:

Syntax:

Example:

Page 38: Introduction to Oracle Spatial

SDO_NN Operator (more examples)

Page 39: Introduction to Oracle Spatial

SDO_RELATE

CONCEPT:

SYNTAX:

EXAMPLE:

Page 40: Introduction to Oracle Spatial

SDO_RELATE

CONCEPT:

Page 41: Introduction to Oracle Spatial

SDO_RELATE

CONCEPT:

Page 42: Introduction to Oracle Spatial

SDO_RELATE

Syntax:

Example:

Page 43: Introduction to Oracle Spatial

SDO_RELATE

More Example:

Page 44: Introduction to Oracle Spatial

Geometry Processing Functions

No Need For Spatial Index! more detailed analyses can appear in the SELECT list (as well as the

WHERE clause)

GP Function: 1-Buffering Function 2- Relationship Function 3- Geometry Combination Function 4- Geometric Analysis Function 5- Aggregate Function

Page 45: Introduction to Oracle Spatial

Buffering Function

Concept

Page 46: Introduction to Oracle Spatial

Buffering Function

Syntax:

Example:

Page 47: Introduction to Oracle Spatial

Relationship Analysis Functions

SDO_DISTANCE Concept:

Page 48: Introduction to Oracle Spatial

Relationship Analysis Functions

SDO_DISTANCE Syntax:

Example:

Page 49: Introduction to Oracle Spatial

Relationship Analysis Functions

Relate Syntax

Page 50: Introduction to Oracle Spatial

Relationship Analysis Functions

Relate Example:

Page 51: Introduction to Oracle Spatial

Geometry Combination Functions

Concept

Page 52: Introduction to Oracle Spatial

Geometry Combination Functions

Syntax:

Examples:

Page 53: Introduction to Oracle Spatial

Geometry Combination Functions

Page 54: Introduction to Oracle Spatial

Geometric Analysis Functions

Numeric Area Length Volume

Page 55: Introduction to Oracle Spatial

Geometric Analysis Functions

Geometric MBR Convex Hall Centroid

Page 56: Introduction to Oracle Spatial

Aggregate Functions

AGGR_MBR AGGR_CONVEXHULL AGR_UNION

Page 57: Introduction to Oracle Spatial

Aggregate Functions

Page 58: Introduction to Oracle Spatial

REVIEW

CREATE SPATIAL TABLE SDO_GEOMETRY (DML) CREATE SPATIAL INDEX INSERT SPATIAL METADATA SPATIAL OPERATORS SPATIAL FUNCTIONS

Page 59: Introduction to Oracle Spatial

REFERENCE

Pro Oracle Spatial for Oracle Database 11g

Oracle® Spatial and Graph Developers’ Guide (E49172-06)

Page 60: Introduction to Oracle Spatial

THANKS