User's Guide and Reference


How to create and use a DB2 Spatial Extender GIS

You create a DB2 Spatial Extender GIS by setting up DB2 Spatial Extender and developing GIS projects within the combined environments of DB2 Spatial Extender and its underlying DB2 RDBMS. You use the GIS by implementing these projects; that is, by generating and analyzing the information--both spatial and traditional--that they are designed to provide. The entire effort involves performing several sets of tasks. This section introduces the interfaces with which you can perform these tasks, provides an overview of the tasks, and presents a scenario to illustrate them.

Interfaces to DB2 Spatial Extender and associated functionality

This section surveys the interfaces by means of which you can create a DB2 Spatial Extender GIS (that is, set up resources for it, obtain spatial data, and so on) and use it (that is, generate and analyze information about geographic features).

You can create a DB2 Spatial Extender GIS by:

You can use a DB2 Spatial Extender GIS by:

Tasks you perform to create and use a DB2 Spatial Extender GIS

This section provides an overview of the tasks through which you create and use a DB2 Spatial Extender GIS. The tasks through which you create the GIS involve setting up DB2 Spatial Extender and developing GIS projects. The tasks through which you use the GIS involve implementing the projects. This overview begins with setting up DB2 Spatial Extender, and then moves on to developing and implementing a GIS project. The section concludes by indicating how the tasks described in the overview can vary in actual practice.

Setting up DB2 Spatial Extender

To set up DB2 Spatial Extender:

  1. Plan and make preparations (decide what GIS projects to develop, decide what database to enable for DB2 Spatial Extender, select personnel to administer DB2 Spatial Extender and develop the projects, and so on).
  2. Install DB2 Spatial Extender.
  3. Put resources in place to support GIS projects; for example:

    Resources supplied by DB2 Spatial Extender
    These include a system catalog, spatial data types, spatial functions (including a default geocoder), and so on. The task of setting up these resources is referred to as enabling the database for spatial operations.

    Geocoders developed by users, vendors, or both.
    The default geocoder translates United States addresses into spatial data. Your organization and others can provide geocoders that translate foreign addresses and other kinds of attribute data into spatial data.

For instructions on installing DB2 Spatial Extender, see Installing DB2 Spatial Extender. For instructions on using the Control Center to put resources in place, see Setting up resources. For guidelines on using an application program for this purpose, see Writing applications for DB2 Spatial Extender. For a scenario that illustrates the overall effort of setting up DB2 Spatial Extender, see A system to integrate spatial and traditional data.

Developing and implementing a GIS project

To develop and implement a GIS project:

  1. Plan and make preparations (set goals for the project, decide what tables and data you need, determine what coordinate system or systems to use, and so on).
  2. Decide what spatial reference system or systems to use. Coordinate values typically include positive integers, negative numbers, and decimal numbers. DB2 Spatial Extender, however, must store all coordinate values in the form of positive integers. A spatial reference system is a set of parameters that defines how negative and decimal numbers in a specific coordinate system are to be converted into positive integers, so that DB2 Spatial Extender can store them. After you decide what coordinate system to use for a spatial column, you need to specify the spatial reference system by which the necessary conversion can take place for that column. If an existing spatial reference system meets your requirements, you can use it; otherwise, you can create one.
  3. Define one or more columns to contain spatial data, register them to DB2 Spatial Extender, and enable a geocoder to maintain them automatically.

    Registering a spatial column involves recording it in the DB2 Spatial Extender catalog. From the time that you register it, it is called a layer, because information generated from it will add a stratum, or layer, to the virtual geographic landscape that your GIS creates for you. After you register it, you can perform spatial operations on it; for example, you can populate it and define a spatial index on it.

  4. Populate spatial columns:
  5. Facilitate access to spatial columns. Specifically, this involves defining indexes that enable DB2 to access spatial data quickly, and defining views that enable users to retrieve interrelated data efficiently. After you define such a view, you need to register its spatial columns as layers.
  6. Generate and analyze spatial information and related business information. This involves querying spatial columns and related attribute columns. In such queries, you can include DB2 Spatial Extender functions that return a wide variety of information; for example, the minimum distance between two geographic features, or coordinates that define an area that surrounds a geographic feature. For information about the function that returns such coordinates, ST_Buffer, see Using other spatial data as source data and ST_Buffer. For examples of queries that use spatial functions, see Retrieving and analyzing spatial information and Spatial functions for SQL queries.

For instructions on using the Control Center to perform the tasks involved in developing a GIS project, see:

For guidelines on using the Control Center to implement a GIS project, see Retrieving and analyzing spatial information.

For guidelines on using an application program to develop and implement a GIS project, see Writing applications for DB2 Spatial Extender.

For a scenario that illustrates the overall effort, see A project to establish offices and adjust premiums.

How the sets of tasks can vary

The sets of tasks that you perform to create and use a DB2 Spatial Extender GIS can vary in content and sequence, depending on your requirements and on the interfaces that you use. For example, consider the tasks of defining columns to contain spatial data, registering them as layers, and enabling a geocoder to maintain them automatically. With the Control Center, you can perform these tasks together, from a single window. If you are invoking stored procedures from a program, however, you can perform these tasks separately, and you can time them at your discretion.

Scenario: An insurance company updates its GIS

This section presents a scenario to illustrate the sets of tasks that are described in the preceding section.

The Safe Harbor Real Estate Insurance Company's information systems environment includes a DB2 Universal Database system and a separate GIS database management system. To an extent, queries can retrieve combinations of data from the two systems. For example, a DB2 table stores information about revenue, and a GIS table stores the locations of the company's branch offices. Therefore, it is possible to find out the locations of offices that bring in revenues of specified amounts. But data from the two systems cannot be integrated (for example, users cannot join DB2 columns with GIS columns) and DB2 services such as query optimization are unavailable to the GIS. To overcome these disadvantages, Safe Harbor acquires DB2 Spatial Extender and establishes a new GIS development department. The following sections describe how the department sets up DB2 Spatial Extender and carries out its first project.

A system to integrate spatial and traditional data

To set up DB2 Spatial Extender, Safe Harbor's GIS development department proceeds as follows:

  1. The department prepares to include DB2 Spatial Extender in its DB2 environment. For example:
    1. The department's management team appoints a spatial administration team to install and implement DB2 Spatial Extender, and a spatial analysis team to generate and analyze spatial information.
    2. Because Safe Harbor's business decisions are driven primarily by customers' requirements, the management team decides to install DB2 Spatial Extender in the database that contains information about its customers. Most of this information is stored in a table called CUSTOMERS.

      As a convenient way to refer to the selected database, the members of the GIS development department call it a GIS database. They are aware, however, that it is not reserved for GIS projects only; non-spatial applications can continue to use it, as before.

  2. The spatial administration team installs DB2 Spatial Extender.
  3. The spatial administration team sets up resources that GIS projects will require:

A project to establish offices and adjust premiums

To carry out its first GIS project under DB2 Spatial Extender, the GIS development department proceeds as follows:

  1. The department prepares to develop the project; for example:
  2. Using the Control Center, the spatial administration team creates two spatial reference systems. One determines how coordinates that define offices' locations are to be converted to data items that DB2 Spatial Extender can store. The other determines how coordinates that define locations of customers' residences are to be converted to data items that DB2 Spatial Extender can store.
  3. Using the Control Center, the spatial administration team defines columns to contain spatial data, registers them as layers, and enables a geocoder to maintain them automatically:
  4. The spatial administration team populates the CUSTOMER table's LOCATION column, the entire OFFICES table, and a new HAZARD_ZONES table:
  5. Using the Control Center, the spatial administration team facilitates access to the new layers:
  6. The spatial analysis team runs queries to obtain information that will help it meet the original objectives: to determine where to establish new branch offices, and to adjust premiums on the basis of customers' proximity to hazard areas.


[ Top of Page | Previous Page | Next Page ]