Sie sind auf Seite 1von 34

Software Group Spatial Information Management

2004 IBM Corporation


Putting the world in your Database:
The Informix Spatial and Geodetic DataBlades
Robert Uleman
Consulting IT Specialist
Worldwide Information Management Sales Support
Spatiotemporal Technology
Software Group Spatial Information Management
2003 IBM Corporation 2
Agenda
Overview
GIS: Geographic Information Systems
Spatial data in an object-relational DBMS
The Spatial DataBlade
Competitive differences
Details
Spatial SQL syntax
Spatial indexing
Geodetic: round-earth spatial
Software Group Spatial Information Management
2003 IBM Corporation 3
Geographic Information System
Software Group Spatial Information Management
2003 IBM Corporation 4
Software Group Spatial Information Management
2003 IBM Corporation 5
GIS
Application
SQL
Proprietary
data format
1
st
Generation:
2
nd
Generation:
3
rd
Generation:
SQL
Proprietary
GIS API
Proprietary
GIS API
GIS
Application
GIS
Application
File
System
GIS
Data
Engine
RDBMS
Spatial
Application
Architectural Evolution of GIS Data Management
Spatially
enabled
DBMS
RDBMS
SQL
Spatial
features,
indexes in
BLOBs
Attributes
GIS
Data
Engine
Spatial types
functions
indexes
Spatial
Features
Proprietary
spatial
structures
Open or
proprietary
Open
Spatial business logic
Software Group Spatial Information Management
2003 IBM Corporation 6
Whats Special about Spatial?
Traditionally not supported by relational databases
Requires new indexing techniques
Voluminous data
Individual values can get arbitrarily large:
Large, convoluted lines and polygons (e.g., a coastline)
Raster images
Lots of features
Maps can effectively represent lots of information
Much more than spreadsheets or reports
Queries often retrieve many more rows than normal
queries
Individual operations may be computationally expensive
WHERE clause predicates
Transactions generally long, unlike OLTP
Resembles code revision control in software development
Software Group Spatial Information Management
2003 IBM Corporation 7
Extender/DataBlade Introduction: Component Technology
Connectivity Backup Restore
Server Subsystems
IDS
Spatial
Geodetic
Grid
Your idea goes here
Software Group Spatial Information Management
2003 IBM Corporation 8
Extender/DataBlade Elements
Types
Functions
Casts
Aggregates
Indexes
Tables
Client Code
New
Extender/
DataBlade
Software Group Spatial Information Management
2003 IBM Corporation 9
If Integer were not built in
Domain
Whole numbers, up to some maximum magnitude
Data types
Smallint, Integer, Bigint
Representations: ASCII ([+|-]d..),
binary (2s complement, byte order)
Functions and operators
Add(+), Subtract(-), Multiply(*), Abs, Mod,
Equal(=), LessThan(<), GreaterThanOrEqual(>=),
Index support
B-Tree
Software Group Spatial Information Management
2003 IBM Corporation 10
Integer not built in? Not so far-fetched
Illustra: Pure object-relational database
Commercialization of UC Berkeley Postgres project
Acquired by Informix in 1996, Informix acquired by IBM in 2001
Postgres continues as open-source PostgreSQL
No built-in data types; everything is bound at runtime
Land Information New Zealand: Fraction data type 5/7
Avoid roundoff in cumulative subdivision of property
Legally mandated improvement in area/tax calculation
precision
Dates
Birthdate: understands that February 28 is a birthday for
someone born on February 29
Tradingdate: skips weekends, holidays
Software Group Spatial Information Management
2003 IBM Corporation 11
User-Defined Data Types
compensation location name jobs_held
CREATE TABLE employee (
name varchar(30),
compensation salary_t,
location point,
jobs_held set(varchar(30)),
picture image
);
John T. Smith (123 256) Clerk, Administrator, Manager
image
349,876 yen
Data Type: Descriptor assigned to a column or a variable
Software Group Spatial Information Management
2003 IBM Corporation 12
Some SQL Queries
Location-Based Services: List Points of Interest
SELECT name, description, address
FROM restaurants
WHERE Overlaps(location, box(getGPS(), 2000, 2000))
AND category = chinese
AND docContains(menu, Peking duck);



List volcanic eruptions in a region of interest
SELECT name, year, mag, location
FROM volcano
WHERE ST_Within(location,
'polygon((-125 43,-125 46,-120 46,-120 43,-125 43))')
ORDER BY name, year;
name year mag location
HOOD MOUNT 1854 0 POINT (-121.69999 45.36000)
HOOD MOUNT 1859 2 POINT (-121.69999 45.36000)
Name Description Address
Dynastie Chinese restaurant in
glass pyramid
Misburger Str. 81
Software Group Spatial Information Management
2003 IBM Corporation 13
OpenGIS Standard Spatial Types and Functions
Certified compliant with OpenGIS Simple Features Specification
Geometric data types
ST_Point, ST_Linestring, ST_Polygon, ST_Geometry, etc.
Spatial functions
ST_Distance, ST_Intersects, ST_Within, etc.
Standard Data representations
Well-Known Binary, Well-Known Text, ESRI Shape
Tailored to ESRIs ArcSDE 9.x (spatial database gateway)
Additional functions, support for annotation, SDE format, etc.
Based on ESRIs geometry engine (Shape library)
Consistent results of spatial operations in all software tiers:
database, middle (ArcSDE), client (ArcGIS, ArcIMS)
The Informix Spatial DataBlade
Software Group Spatial Information Management
2003 IBM Corporation 14
DB2 Spatial Extender, IDS Spatial DataBlade
Developed, supported and maintained by IBM
Wrapped around ESRIs geometry engine (Shape library)
Spatial index: R-tree
Spatially aware optimizer
Recognizes spatial operators and index
Cost, selectivity provided by R-tree
Administration tools: Blade Manager
Utilities: Shape file import, export
Strategic alliance with ESRI
Close relationship in engineering, marketing, and sales
Software (Data, WebSphere), Hardware, Services
Software Group Spatial Information Management
2003 IBM Corporation 15
Spatial/OpenGIS SQL Data Types
ST_Geometry
ST_Curve ST_Surface
ST_Geom-
Collection
ST_Multi-
Surface
ST_Multi-
Curve
ST_LineString ST_Polygon
ST_Point
ST_Multi-
Polygon
ST_Multi-
LineString
ST_Multi-
Point
Abstract Classes
Instantiable Classes
Software Group Spatial Information Management
2003 IBM Corporation 16
OpenGIS Spatial SQL Functions
ST_Intersects(geometry1,geometry2)
?
Software Group Spatial Information Management
2003 IBM Corporation 17
Client
SDE
Client API
ArcGIS Family

Open API
Application
ArcSDE
Server
IDS
SQL
Applications
Spatial
DataBlade
ArcSDE Architecture for Informix
R-tree index
ODBC
OpenGIS
Spatial
Queries
Caching
Compression
Connection pooling
(Projections)
(Long transactions)
(Raster support)
ESQL/C
ODBC
JDBC
TCP/IP
Geodatabase,
business rules,
custom types
ArcExplorer
JDBC
Software Group Spatial Information Management
2003 IBM Corporation 18
FAT
ArcSDE
Server
<nothing>
ArcSDE Architecture for Others
SQL
Applications
ArcSDE
Server
Oracle
Oracle
Spatial
Index tables
SQL
Applications
NO Spatial
Queries
Oracle
Spatial
Queries
ArcSDE
Server
Informix
Spatial
DataBlade
SQL
Applications
OpenGIS
Spatial
Queries
SQLServer,
Oracle binary
Software Group Spatial Information Management
2003 IBM Corporation 19
The Informix Spatial Advantage
Standard, intuitive syntax
Easy development, maintainable, fewer bugs
Result of true Object-Relational extensibility
OpenGIS Simple Features conformance for interoperability
with other compliant systems
Performance
Spatial index and functions integrated into server at code
interface level, not based on tables and SQL
Tight cooperation and integration with ESRI
Software Group Spatial Information Management
2003 IBM Corporation 21
SQL Comparisons: Query
Oracle Spatial
SELECT A.Feature_ID
FROM TARGET A
WHERE
sdo_relate(
A.shape,
mdsys.sdo_geometry(
2003,
NULL,
NULL,
mdsys.sdo_elem_info_array(
1,1003,1
),
mdsys.sdo_ordinate_array(
x1,y1, x2,y2, x3,y3, x4,y4,
)
),
'mask=anyinteract querytype=window
) = 'TRUE
;
DB2 Spatial
SELECT A.Feature_ID
FROM A
WHERE
ST_Overlaps(
A.shape,
ST_GeomFromText(
ST_POLYGON(
x1 y1, x2 y2, x3 y3, x4 y4
),
5 -- OpenGIS requirement
)
)
;
Software Group Spatial Information Management
2003 IBM Corporation 22
Spatial queries
Compute the percentage overlap of imagery that covers part of a
region of interest
ROI = Ontario Province, with 25 km buffer, but only over Canada
SELECT
i.id AS image_id,
ST_Area(ST_MultiPolygon
ST_Intersection( i.footprint, p.shape )
::ST_Polygon
) / ST_Area( i.footprint ) * 100 AS "%overlap"
FROM images i, provinces p
WHERE ST_Overlaps(
i.footprint,
ST_Difference(
ST_Buffer( p.shape, 25, 'KILOMETRE' ),
(SELECT shape FROM countries WHERE name = 'USA')
) AND p.name = 'Ontario'
ORDER BY 2 DESC;
Software Group Spatial Information Management
2003 IBM Corporation 25
The B-tree index
A through Z
A - I S - Z
A - B C - E P - R Sq - U
B-tree indexes rapidly reduce the number of items to search
through in a selection process and are the industry standard for
alpha-numeric data. But how can spatial data be sorted???
J - R
F - I M - O J - L S - Sp V - Z
Polygon
N2
N1
K8 K9
L4
K8
K9
L5
K10
K11
N1 N2
L4 L5
K10 K11
A Simple R-tree
K = Key bounding box
L = Leaf node bounding box
N = Node (internal) bounding box
L1
L2 L3
L1 L2
K1
K1
K2
K4
K3
K5
K6
K7
L3
K5 K6 K7 K2 K3 K3 K4
Data space
Index structure
Search
Object
Software Group Spatial Information Management
2003 IBM Corporation 27
Planar Coordinates
500,000
5,000,000
Northing
Easting
Software Group Spatial Information Management
2003 IBM Corporation 28
longitude
latitude
0
-90
(90 W)
+90
(90 N)
R
Spherical Coordinates
Software Group Spatial Information Management
2003 IBM Corporation 29
Flattening the Earth
Plane Geometry on lat-long
Singularities and scale
distortion at and toward the poles
Wrap-around
at 180 longitude
Poor location of lines, edges, intersections
Local/Regional Projections
Limited valid range
Map edge-matching problems
Non-uniform scale
Indexing: it gets worse!
Multiple bounding boxes or complete loss of selectivity
UTM
32
UTM
33
?
?
?
?
0
0 -180 +180
-90
+90
Software Group Spatial Information Management
2003 IBM Corporation 30
FLAT
0 180 180
Single
bounding
box: high
selectivity,
low
complexity
+180 -180 0 +90 -90
-90
0
+90
Y
X
Single
bounding
strip: low
selectivity
Split
bounding
boxes: high
complexity
ROUND
Software Group Spatial Information Management
2003 IBM Corporation 31
Geodetic DataBlade/Extender
Latitude-longitude (geodetic) coordinates, ellipsoidal datum
Uniform accuracy and resolution around the globe (world to cm)
No scale singularities and map edges
Based on Hipparchus geometry engine by Geodyssey Ltd.
Integrated time and floating-point dimensions for single-index
searches and true spatio-temporal data management
Powerful indexes for high performance:
Voronoi Tessellation adaptive space partitioning
R-tree self-tuning multidimensional index (up to 5
dimensions)
Unique to IBM
Software Group Spatial Information Management
2003 IBM Corporation 32
Connect the dots...
Flat plane: line segments
connecting vertices are
straight lines
Ellipsoid: line segments
connecting vertices are
geodesics
Software Group Spatial Information Management
2003 IBM Corporation 33
Connect the dots, continued
parallels
meridians
Add vertices if you want a line segment
to follow a parallel (line of constant latitude)
Software Group Spatial Information Management
2003 IBM Corporation 34
Distances
What is the distance from Anchorage to Tokyo?
The shortest path is the shorter of the
two possible geodesic paths:
the thick part of the great circle
Software Group Spatial Information Management
2003 IBM Corporation 35
Polygons that straddle the 180th meridian
split flat-plane representation into 2 or more pieces
MULTIPOLYGON(
((-180 30,-165 30,-165 40,
-180 40,-180 30)),
((180 30,180 40,165 40,
165 30, 180 30))
)
POLYGON(
(165 30, -165 30,
-165 40, 165 40)
)
Software Group Spatial Information Management
2003 IBM Corporation 36
Polygons that enclose a pole
extra vertex extra vertex extra edge extra edge
POLYGON(
(180 -60, -180 -60, -180 -90,
180 -90, -180 -60)
)
POLYGON(
( 0 -60, -120 -60,
120 -60, 0 -60)
)
Software Group Spatial Information Management
2003 IBM Corporation 37
Hemispheres
Western hemisphere,
flat-earth representation:

POLYGON((0 -90, 0 90,
-180 90, 180 -90, 0 -90))
Western hemisphere,
round-earth representation:

POLYGON((0 -30, 0 90, 180 -30))
1
2
3
4
1
2
3
Note that the same three points, specified in
opposite order, define the eastern hemisphere

Das könnte Ihnen auch gefallen