john pickford ibm

31
John Pickford IBM H11 Wednesday, October 4, 2006 • 13:30. – 14:30. Platform: Informix Practical Applications of IDS Extensibility (Part 2 of 2)

Upload: wilhelmina-carter

Post on 03-Jan-2016

40 views

Category:

Documents


0 download

DESCRIPTION

H11. Practical Applications of IDS Extensibility (Part 2 of 2). John Pickford IBM. Wednesday , October 4, 2006 • 13:30. – 14:30. Platform: Informix. Key Points. What is Spatial Data Spatial coordinate systems What is the Spatial Datablade What are Spatial Applications Other uses. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: John Pickford IBM

John PickfordIBM

H11

Wednesday, October 4, 2006 • 13:30. – 14:30.

Platform: Informix

Practical Applications of IDS Extensibility (Part 2 of 2)

Page 2: John Pickford IBM

2

Key Points

• What is Spatial Data

• Spatial coordinate systems

• What is the Spatial Datablade

• What are Spatial Applications

• Other uses

Page 3: John Pickford IBM

3

What is Spatial Data ?

• Data related to a location• Location• Data relating to that location or a set of

locations

• Location is specified as a point on a co-ordinate system• Flat Earth• More realistic shaped Earth

Page 4: John Pickford IBM

4

Spatial co-ordinate systems

• Flat Earth• Conic

• A portion of the Earth's surface is projected onto a cone. The cone is then flattened

• Mercator• The Earth's sphere is

flattened out. In this projection the further away from the axis a point is, the larger it seems

Page 5: John Pickford IBM

5

Spatial co-ordinate systems

Page 6: John Pickford IBM

6

Spatial co-ordinate systems

• Geodetic Data• Points specified by

longitude and latitude

• Much more complex• what is a straight line ?• what is the distance

between 2 points ?longitude

latitude

0-90

(90° W)

+90(90° N)

R

Page 7: John Pickford IBM

7

Where is Spatial Data Used ?

• Geographical Information Systems (GIS)• Store spatial data• Analyse spatial data• Display spatial data

• Could be used in CAD/CAM

• Others ?

Page 8: John Pickford IBM

8

What is the Spatial DataBlade ?

• Some data types• Basic type is a point

• x and y•co-ordinate system

• z (optional)• m (optional)

• Spatial types• Point(s)• Line(s)• Polygon(s)

• Some functions• Standard OGC

functions• Additional functions

• Support for different co-ordinate systems

• Spatial Index Support

• Some utilities• Load shapes

Page 9: John Pickford IBM

9

Spatial Data Types

• Point(s)

• Line(s)• They can cross (themselves and

each other)

• Polygon(s)• A polygon must have the same

start and end point• They can not cross themselves or

each other but can touch

Page 10: John Pickford IBM

10

Spatial Data Types

• Each point can have• A z co-ordinate (height, depth, …)• A measure (e.g. time)

• The 'measure' can be interpolated

Page 11: John Pickford IBM

11

Spatial Functions

• Convert geometries from/to:• Text• Well Known Binary (WKB)• ESRI Shape files

• Convert geometries to:• GML

Page 12: John Pickford IBM

12

Spatial Functions• Get parameters

• Dimensions of coordinates and geometry• Data type• Number of points• SRID• Max/Min of x, y, z, m

• Manipulation• Get the x, y, z, m of a point• Get the first, mid, nth, last point of a line• Get the area, centre, perimeter• Get the nth geometry in a in a "multi"

Page 13: John Pickford IBM

13

Spatial Functions

• Relationships between geometries:• Contain each other• Cross• Intersect• Overlap• Touch• Disjoint• Equal

Page 14: John Pickford IBM

14

Spatial Functions

• Create new from existing:• Union• Intersection• Difference• Perpendicular projection• Buffer• Boundary• Envelope• Generalize

Page 15: John Pickford IBM

15

Spatial Functions

• Nearest neighbour

• SRID management• Get the SRID of a geometry• Transform from one SRID to another

• Administration• Get sizes

Page 16: John Pickford IBM

16

Spatially Enabling a Database

• Two easy steps:• Get the spatial DataBlade• Use "Blade Manager" to add it to the database

Page 17: John Pickford IBM

17

Inserting Spatial Data

• Create table with spatial columncreate table gpsDemo

(seRowId char(10), path st_linestring);

• Insert datainsert into gpsDemo values ('a',

st_linefromtext('linestring zm(

0. 0. 0. 100, 1. 1. 0. 110,

2. 2. 0. 120, 3. 3. 0. 130

)', 4));

Page 18: John Pickford IBM

18

Selecting Spatial Data

• Select:select * from gpsDemo;

seRowId path

a 4 LINESTRING ZM (0. 0. 0. 100, …..

select seRowId, st_envelope(path) from gpsDemo;

seRowId path

a 4 POLYGON ((0. 0., 3. 0., 3. 3., …..

Page 19: John Pickford IBM

19

Evolution of GIS Data Management

GIS Application

GIS Application

SQL

Proprietarydata format1st Generation:

2nd Generation:

3rd Generation:SQL

ProprietaryGIS API

ProprietaryGIS APIGIS

Application

GIS Application

GIS

Application

GIS

Application

FileSyste

m

FileSyste

m

GIS Data

Engine

GIS Data

Engine RDBMSRDBMS

“Spatial” Application

“Spatial” Application

Spatially enabled DBMS

Spatially enabled DBMS

RDBMSRDBMSSQL

Spatial features, indexes in

BLOBs

Attributes

GIS Data

Engine

GIS Data

Engine

Spatial types functions indexes

Spatial Features

Proprietaryspatial

structures

Open or proprietary

Open

Spatial business logicSpatial business logic

Page 20: John Pickford IBM

20

App ServerApp ServerExtensibleRDBMS

ExtensibleRDBMS

Spatial dataSpatial data

Data Business Logic

Client

HTTP

Serv

er

HTTP

Serv

er

Thin-Client

Bro

wser

Bro

wserIntran

et Intern

etEJBsEJBs

CorporateApplications

CorporateApplications

Java App

Java App

Java App

Java App

Java App

Java App

WebService

WebService

WebService

WebService

Service

ExtensibleRDBMS

ExtensibleRDBMS

Spatial dataSpatial data

Service-Oriented Architecture

Page 21: John Pickford IBM

21

DataBlade Component Technology

ConnectivityConnectivity BackupBackup RestoreRestoreServer SubsystemsServer Subsystems

DB2/IDSDB2/IDSDB2/IDSDB2/IDSSpatialGeodetic

GridYour idea goes here

SpatialGeodetic

GridYour idea goes here

Page 22: John Pickford IBM

22

DataBlade Elements

TypesTypes

FunctionsFunctions

CastsCasts

AggregatesAggregates

IndexesIndexes

TablesTables

Client CodeClient Code

New New Extender/Extender/DataBladeDataBlade

New New Extender/Extender/DataBladeDataBlade

Page 23: John Pickford IBM

23

R-Tree Indexing

• Not part of the Spatial Datablade but key to Spatial Data Management

• Index still organised as a tree structure but they point to Regions

• Not limited to 2 dimensions

Root

Branch Branch Branch

Leaf Leaf

Page 24: John Pickford IBM

24

R-Tree indexing

• Not limited to spatial data

• Consider times and time periods

Y

X

Start time

End time

Time period

Page 25: John Pickford IBM

25

Spatial Clients

• There are different ways to access the data from a client program• Java Class Library• ESQL/C• ODBC/JDBC

Page 26: John Pickford IBM

26

Server Access

• Spatial data can be access in the server• SPL• UDF

Page 27: John Pickford IBM

27

A mini Spatial Application

• A small demo to show how spatial data can be stored and displayed• Base GIS demo data distributed free with the datablade

as ESRI shape files• Data loaded into IDS tables using the loadshp program• Data read as GML into a php script started by accessing

the php file from a browser (Firefox 1.5.0.4 with xfrorms extension)

• GML data transformed to SVG and display as graphics

Page 28: John Pickford IBM

28

A mini Spatial Application – Results

Page 29: John Pickford IBM

29

A mini Spatial Application – Results

Page 30: John Pickford IBM

30

A mini Spatial Application – Results

lat long Speed Dir Time

-2.20214 51.87797 3.8 54.1 00:00

-2.20196 -51.87807 4.6 57.2 00:10

2.20176 51.87816 5.7 57.6 00:20

Page 31: John Pickford IBM

31

John PickfordIBM

[email protected]

H11Practical Applications of IDS Extensibility (Part 2 of 2)