10
Spatial Query Language Group No.15 Dhruv Dhokalia Yash Khandelwal Course Relation- Chapter 11- Object and Object- Relational Databases

Spatial Query Language

  • Upload
    mandy

  • View
    61

  • Download
    1

Embed Size (px)

DESCRIPTION

Spatial Query Language. Course Relation- Chapter 11- Object and Object-Relational Databases. Group No.15 Dhruv Dhokalia Yash Khandelwal. MOTIVATION. Databases required for data type rich applications such as: - Spatial Databases ( eg . Google Maps) - PowerPoint PPT Presentation

Citation preview

Page 1: Spatial Query Language

Spatial Query Language

Group No.15Dhruv Dhokalia

Yash Khandelwal

Course Relation- Chapter 11- Object and Object-Relational Databases

Page 2: Spatial Query Language

MOTIVATION

• Databases required for data type rich applications such as:- Spatial Databases (eg. Google Maps)- Designing Databases (eg. CAD/CAM, 3-D printing)

• These applications require: -Complex structures for storing data-New data types- for images, videos & other multimedia

Page 3: Spatial Query Language

RDBMS Data types

CharInt

DateNumberVarchar

ODBMS Data types

PointLineStringPolygon

MultiPoint

SEMANTIC GAP

Page 4: Spatial Query Language

Spatial Data Types

Page 5: Spatial Query Language

OGIS- Open Geographic Information System

OPERATION TYPE OPERATION NAME DESCRIPTION

Basic functions SpatialReference() Returns the underlined coordinate system of the geometry

Boundary() Returns the boundary of the geometry

Topological/Set Operators Touch() Returns TRUE if the boundaries of the two surfaces intersect, but the interiors DO NOT

Contains() Test if the given geometry contains another geometry

Cross() Returns TRUE if the interior of a surface intersects with a curve

Spatial Analysis Distance() Returns the shortest distance b/w two geometries

Intersection() Returns the geometric intersection of the two geometries

Page 6: Spatial Query Language

Spatial Query Example

CREATE TABLE Country(Name Varchar(30),Continent Varchar(30),Population Integer,GDP Number,Shape Polygon);

CREATE TABLE River(Name Varchar(30),Origin Varchar(30),Length Number,Shape LineString);

Page 7: Spatial Query Language

Spatial Query Example(cont.)

Find the names of all the countries that are neighbors of USA in the country table.

SELECT C1.Name AS “neighbors of USA”FROM Country C1, C2WHERE Touch (C1.Shape, C2.Shape)= 1 ANDC2.Name= “USA”;

Page 8: Spatial Query Language

Spatial Query Example(cont.)

List the length of all the rivers in each of the countries they pass through

SELECT R.Name, C.Name, Length(intersection(R.Shape, C.Shape)) AS LengthFROM River R, Country CWHERE Cross (R.Shape, C.Shape)=1;

Page 9: Spatial Query Language

References

• Spatial Databases- A TOUR By Shashi Shekhar; Sanjay Chawla • Fundamentals of Database Systems

By Elmasri & Navathe; 6th Edition

• About 3-D Printing http://www.3ders.org/3d-printing-basics.html• Latest on 3-D printing

http://www.cnn.com/2013/11/08/tech/innovation/3d-printed-metal-gun/index.html?hpt=te_r1

Page 10: Spatial Query Language

THANK YOU