How To Spatially Enable Your IBM Informix Database

Download Report

Transcript How To Spatially Enable Your IBM Informix Database

IBM Software Group
How To Spatially Enable
Your IBM Informix Database
Chris Bosch, Software Engineer
IBM DB2 Information Management
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Agenda
 Introduction
– spatial data models
– spatial standards
– spatial products
– spatial partners
 Geometry concepts
 Spatially enabling your database
 Resources for further information
2
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Introduction: spatial data models
 Spatial data is modeled as
raster or vector, and …
3
 … organized as collections
of thematic layers
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Introduction: spatial standards
 Open GIS Consortium (OGC)
– OpenGIS Simple Features Specification for SQL,
Revision 1.1
• SQL92 implementations (SFS NG)
– using numeric SQL types for geometry storage and ODBC
access.
– using binary SQL types for geometry storage and ODBC access.
• SQL92 with Geometry Types implementations (SFS TF)
– supporting both textual and binary ODBC access to geometry.
 SQL/MM (Multi-Media)
4
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Introduction: spatial products
 Products Implementing or Complying to OGC
Simple Features - SQL - Types and Functions 1.1
Product
Version
Status
Contact
Organization
ArcSDE for Informix
8.1
Compliant
Danko, David
ESRI
Spatial Database Engine for Informix
3.0.2
Compliant
Danko, David
ESRI
ArcSDE for DB2
8.1
Compliant
Danko, David
ESRI
Spatial Database Engine for DB2 Datajoiner
3.0.2
Compliant
Danko, David
ESRI
IBM DB2 Spatial Extender
7.1
Compliant
Adler, David
IBM Corporation
IBM DB2 Spatial Extender
8.1
Compliant
Adler, David
IBM Corporation
IBM DB2 Spatial Extender
7.1
Compliant
Adler, David
IBM Corporation
Spatial DataBlade Module
8.1
Compliant
Stevens, Michael
Informix Software, Inc.
MapInfo SpatialWare
4.5
Implementing
Gordon, Douglas
MapInfo Corporation
PostGIS / PostgreSQL
0.8.0
Implementing
Ramsey, Paul
Refractions Research Inc
10 Registered Implementations of Simple Features - SQL - Types and Functions 1.1.
5
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Introduction: spatial products
 IBM Informix Spatial DataBlade
Module
– V8.10, 2000
– V8.11, 2001
– V8.20, 2002
 IBM Informix Geodetic
DataBlade Module
– V2.11, 1997
 IBM DB2 Spatial Extender
– V7.1, 2000
– V7.2, 2001
– V8.1, 2002
– V8.2, 2004 (open beta)
 IBM DB2 Geodetic Extender
– V8.2, 2004 (open beta)
– V2.12, 1998
– V3.0, 2000
 Other partner products for
Informix Dynamic Server …
6
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Introduction: spatial products
 Spatial vs. Geodetic
– The Spatial DataBlade/Extender treats the earth as a flat map.
• Projecting the curved earth onto a flat map creates distortion around
the edges of the map
• Geometric operations can be inaccurate around those edges.
• The Spatial DataBlade/Extender is best used for regional datasets
and applications.
– The Geodetic DataBlade/Extender treats the earth as a globe.
• Geometric operations are precise regardless of location.
• The Geodetic DataBlade/Extender is best for global datasets and
applications, such as satellite imagery repositories.
7
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Introduction: spatial partners
 ESRI
– Provides the shape, projection, and geocoding libraries used by IBM
Informix Spatial DataBlade and DB2 Spatial Extender
 Geodyssey Limited
– Provides the Hipparchus Library used by IBM Informix Geodetic
DataBlade and DB2 Geodetic Extender
 MapInfo
– Developer of SpatialWare DataBlade for Informix Dynamic Server
 Barrodale Computing Services
– Developer of Grid DataBlade for Informix Dynamic Server
 Others …
8
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Agenda
 Introduction
 Geometry concepts
– Projections
– Coordinate Systems
– OGC Geometry Object Model
– Basic Methods on Geometries
– Methods for testing Spatial Relations
– Methods that support Spatial Analysis
 Spatially enabling your database
 Resources for further information
9
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Projections
10
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Conic projections
– A portion of the Earth's
surface is projected onto a
cone. The cone is then
flattened.
 Mercator projections
– The Earth's sphere is
flattened out. In these
projections the further away
from the equator a point is,
the larger it seems.
11
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Coordinate systems
– Geographic
• GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GR
S_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0
174532925199433]]
– Projected
• PROJCS["NAD_1983_10TM_AEP_Forest",GEOGCS["GCS_North_American_1983",DATUM["D
_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM[
"Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_
Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0
.0],PARAMETER["Central_Meridian",115.0],PARAMETER["Scale_Factor",0.9992],PARAMETER["Latitude_Of_Origin",0.0]
,UNIT["Meter",1.0]]
– Geocentric
• GEOCCS["Geocentric",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["Meter",1],AXIS["X",OT
HER],AXIS["Y",EAST],AXIS["Z",NORTH]]
12
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 OGC Geometry Object Model
13
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Basic Methods on Geometries
– Dimension ( ):Integer
– GeometryType ( ):String
– SRID ( ):Integer
– Envelope( ):Geometry
– IsEmpty( ):Integer
– IsSimple( ):Integer
– Boundary( ):Geometry
– AsText( ):String
– AsBinary( ):Binary
14
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Methods for testing Spatial Relations between Geometries
– Equals(anotherGeometry:Geometry):Integer
– Disjoint(anotherGeometry:Geometry):Integer
– Intersects(anotherGeometry:Geometry):Integer
– Touches(anotherGeometry:Geometry):Integer
– Crosses(anotherGeometry:Geometry):Integer
– Within(anotherGeometry:Geometry):Integer
– Contains(anotherGeometry:Geometry):Integer
– Overlaps(anotherGeometry:Geometry):Integer
– Relate(anotherGeometry:Geometry,
intersectionPatternMatrix:String):Integer
15
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Equals
16
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Disjoint
17
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Intersects
18
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Touches
19
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Crosses
20
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Within
21
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Contains
22
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Overlaps
23
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Methods that support Spatial Analysis
– Intersection(anotherGeometry:Geometry):Geometry
– Union(anotherGeometry:Geometry):Geometry
– Difference(anotherGeometry:Geometry):Geometry
– SymDifference(anotherGeometry:Geometry):Geometry
– Buffer(distance:Double):Geometry
– ConvexHull( ):Geometry
– Distance(anotherGeometry:Geometry):Double
24
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Intersection
25
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Difference
26
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Union
27
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 SymDifference
28
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 Buffer
29
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Geometry Concepts
 ConvexHull
30
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Agenda
 Introduction
 Geometry concepts
 Spatially enabling your database
– Product installation and configuration
– Adding spatial types, functions, and index support to your
database
– Adding spatial data to your database
– Demonstration
 Resources for further information
31
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Spatially enabling your database
 Product installation and configuration
– IDS
• Installation of the IBM Informix Spatial DataBlade module is
straightforward
• Update ONCONFIG parameters before registering Spatial
DataBlade module in your database
– SBSPACENAME <sbspacename>
– SYSSBSPACENAME <sbspacename>
– STACKSIZE 64
32
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Spatially enabling your database
 Product installation and configuration
– DB2
• Installation of the DB2 Spatial Extender is straightforward
• Update DB CFG parameters before enabling your database
with Spatial Extender
–
–
–
–
–
33
logfilsiz 1000
logprimary 10
logsecond 2
applheapsz 2048
app_ctl_heap_sz 1024
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Spatially enabling your database
 Adding spatial types, functions, and index support
– IDS
• Register the Spatial DataBlade module in your database
– Command line: blademgr
– GUI: BladeManager (%INFORMIXDIR%\bin\wblademgr.exe)
– DB2
• Enable your database with Spatial Extender
– Command line: db2se enable_db
– GUI: DB2 Control Center (%DB2PATH%\bin\db2cc.bat)
34
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Spatially enabling your database
 Adding spatial data to your database
– Import spatial data from ESRI Data & Maps data bundle
• IDS
– Command line: loadshp
• DB2
– Command line: db2se import_shape
– GUI: DB2 Control Center
– Geocode existing business data
• DB2
– Command line: db2se run_gc
– GUI: DB2 Control Center
35
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Spatially enabling your database
 Demonstration
36
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Agenda
 Introduction
 Geometry concepts
 Spatially enabling your database
 Resources for further information
37
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Resources for further information

IBM Informix Spatial DataBlade module
– http://www.ibm.com/software/data/informix/blades/spatial/

IBM Informix Geodetic DataBlade module
– http://www.ibm.com/software/data/informix/blades/geodetic/

IBM DB2 Spatial Extender
– http://www.ibm.com/software/data/spatial/

Informix Developer Zone
– http://www.ibm.com/developerworks/db2/zones/informix/ids_spatial.html
– http://www.ibm.com/developerworks/db2/zones/informix/library/tech
article/ids_geo_spatial.html
38
7/22/2004
© 2004 IBM Corporation
IBM Software Group | DB2 Information Management Software
Resources for further information
39

Open GIS Consortium
– http://opengis.org/

ESRI
– http://www.esri.com/

Geodyssey Limited
– http://www.geodyssey.com/

Newsgroups and forums
– news://news.software.ibm.com/ibm.software.db2.udb.spatial
– http://www.iiug.org/forums/datablade-list
7/22/2004
© 2004 IBM Corporation