DB2 Spatial Extender User's Guide and Reference
Total Page:16
File Type:pdf, Size:1020Kb
IBM® DB2® Spatial Extender User’s Guide and Reference Ve r s i o n 8 SC27-1226-00 IBM® DB2® Spatial Extender User’s Guide and Reference Ve r s i o n 8 SC27-1226-00 Before using this information and the product it supports, be sure to read the general information under Notices. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/planetwide To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1998 - 2002. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Part 1. Introduction........1 System requirements for installing Spatial Extender............28 Chapter 1. About DB2 Spatial Extender . 3 Installing DB2 Spatial Extender for Windows ............30 The purpose of DB2 Spatial Extender ....3 Installing DB2 Spatial Extender for AIX . 32 Spatialdata............4 Installing DB2 Spatial Extender for HP-UX 34 How data represents geographic features. 4 Installing DB2 Spatial Extender for Solaris Thenatureofspatialdata.......6 Operating Environment .......36 Wherespatialdatacomesfrom.....7 Installing DB2 Spatial Extender for Linux How features, spatial information, spatial data, and Linux OS/390 .........38 and geometries fit together .......8 Creating the DB2 Spatial Extender instance environment...........40 Chapter 2. About Geometries .....11 Verifying the Spatial Extender installation 42 Geometries ............11 Troubleshooting tips for the installation Properties of geometries ........13 sampleprogram.........44 Type.............13 Post-Installation considerations......45 Geometry coordinates ........14 Downloading ArcExplorer ......45 XandYcoordinates........14 Accessing geocoder reference data . 45 Zcoordinates..........15 CD-ROMs for DB2 Spatial Extender data Mcoordinates..........15 andmaps............47 Interior, boundary, and exterior ....15 Simple or non-simple ........15 Chapter 5. Migrating the Spatial Extender Emptyornotempty........15 environment to DB2 Universal Database Minimum bounding rectangle (MBR) . 15 Version 8 ............49 Dimension...........15 Migrating a spatially-enabled database . 49 Spatial reference system identifier ....16 Migrating from a 32–bittoa64–bit environment...........50 Chapter 3. How to use DB2 Spatial Migrationmessages........51 Extender .............17 HowtouseDB2SpatialExtender.....17 Chapter 6. Setting up a database ....53 Interfaces to DB2 Spatial Extender and Configuring a database to accommodate associated functionality .......17 spatialdata............53 Tasks that you perform to set up DB2 Tuning the database configuration parameters 53 Spatial Extender and create projects . 17 Tuning transaction log characteristics . 53 Tuning the application heap size ....55 Part 2. Setting up DB2 Spatial Tuning the application control heap size 56 Extender ............25 Chapter 7. Setting up spatial resources for Chapter 4. Getting started with DB2 Spatial a database ............59 Extender .............27 How to set up resources in your database . 59 Setting up and configuring Spatial Inventory of resources supplied for your Extender—Steps...........27 database ............59 Setting up and configuring Spatial Enabling a database for spatial operations 60 Extender............27 How to work with reference data .....61 Reference data ..........61 © Copyright IBM Corp. 1998 - 2002 iii Table of contents Setting up access to reference data . 61 Environments for performing spatial analysis 119 Registering a geocoder .......62 Examples of spatial function operations . 119 Rules for using grid indexes to optimize Part 3. Creating projects that use spatialfunctions..........121 spatial data ..........63 Chapter 13. DB2 Spatial Extender commands ...........123 Chapter 8. Setting up spatial resources for Invoking commands for setting up DB2 a project .............65 Spatial Extender and developing projects . 123 How to use coordinate systems .....65 Coordinate systems ........65 Chapter 14. Writing applications and Selecting or creating coordinate systems. 73 using the sample program ......131 How to set up spatial reference systems. 74 Writing applications for DB2 Spatial About spatial reference systems ....74 Extender.............131 Selecting or creating spatial reference Including the DB2 Spatial Extender header systems ............76 file in spatial applications .......131 Calling DB2 Spatial Extender stored Chapter 9. Setting up spatial columns . 83 procedures from an application .....132 Spatialcolumns...........83 The DB2 Spatial Extender sample program 134 Spatial columns with viewable content . 83 Spatialdatatypes.........83 Chapter 15. Identifying DB2 Spatial Creatingspatialcolumns........86 Extender problems .........143 Setting up spatial columns for access by How to interpret DB2 Spatial Extender visualizationtools..........86 messages.............143 DB2 Spatial Extender stored procedure Chapter 10. Populating spatial columns . 89 output parameters .........146 How to import and export spatial data . 89 DB2 Spatial Extender function messages . 148 About importing and exporting spatial DB2 Spatial Extender CLP messages . 150 data..............89 DB2 Control Center messages ......153 Importing spatial data .......91 Tracing DB2 Spatial Extender problems with Exporting spatial data........94 the db2trc command .........154 Howtouseageocoder........96 The db2diag.log utility ........155 Geocodersandgeocoding......96 Setting up geocoding operations ....98 Setting up a geocoder to run Part 4. Reference material ....157 automatically ..........101 Running a geocoder in batch mode . 102 Chapter 16. Stored procedures ....159 GSE_export_sde ..........160 Chapter 11. Using indexes and views to GSE_import_sde ..........162 access spatial data.........105 ST_alter_coordsys ..........165 Spatialindexes...........105 ST_alter_srs ............167 Howtocreatespatialgridindexes....106 ST_create_coordsys .........172 Creatingspatialgridindexes.....107 ST_create_srs ...........174 General guidelines for getting the most ST_disable_autogeocoding .......182 outofspatialgridindexes......110 ST_disable_db ...........184 UsingtheIndexAdvisor.......111 ST_drop_coordsys .........186 Using views to access spatial columns . 118 ST_drop_srs............187 ST_enable_autogeocoding .......189 Chapter 12. Analyzing and Generating ST_enable_db ...........191 spatial information .........119 ST_export_shape ..........194 iv DB2 Spatial Extender User’s Guide and Reference Table of contents ST_import_shape ..........198 Functions for information about ST_register_geocoder.........207 geometries within a geometry.....268 ST_register_spatial_column ......212 Functions for information about rings, ST_remove_geocoding_setup ......215 boundaries, envelopes, and minimum ST_run_geocoding .........217 bounding rectangles ........270 ST_setup_geocoding .........220 Functions for information about ST_unregister_geocoder ........224 dimensions...........271 ST_unregister_spatial_column......226 Functions for information as to whether a geometry is closed, empty, or simple . 272 Chapter 17. Catalog views ......229 Functions for information about spatial The DB2GSE.ST_COORDINATE_SYSTEMS reference systems .........272 catalogview...........229 Spatial functions that generate new The DB2GSE.ST_GEOMETRY_COLUMNS geometries ............273 catalogview...........231 Functions for converting geometries into The other geometries .........273 DB2GSE.ST_GEOCODER_PARAMETERS Functions for creating geometries that catalogview...........232 represent configurations of space . 274 The DB2GSE.ST_GEOCODERS catalog view 233 Functions for deriving individual The DB2GSE.ST_GEOCODING catalog view 234 geometries from multiple geometries . 278 The Functions for creating geometries based DB2GSE.ST_GEOCODING_PARAMETERS onmeasures..........279 catalogview...........236 Functions for creating modified forms of The DB2GSE.ST_SIZINGS catalog view . 238 geometries ...........280 The Miscellaneous spatial functions .....282 DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS catalogview...........238 Chapter 19. Spatial functions: syntax and The DB2GSE.ST_UNITS_OF_MEASURE parameters ...........285 catalogview...........242 Spatial functions: considerations and associateddatatypes........285 Chapter 18. Spatial functions: categories Factorstoconsider........285 and uses ............243 Treating values of ST_Geometry as values Spatial functions that convert geometries to ofasubtype..........286 and from data exchange formats .....243 Spatial functions listed according to input Constructorfunctionsingeneral....243 type.............287 Well-known text (WKT) representation 248 MBR Aggregate ..........291 Well-known binary (WKB) representation 249 ST_AppendPoint