User's Guide and Reference

Creating a spatial reference system

This section describes the relationship between spatial reference systems and coordinate systems, and explains how to create a spatial reference system from the Control Center.

About coordinate and spatial reference systems

This section continues the discussion of coordinate systems that was begun in The nature of spatial data. Then it expands on the definition of spatial reference systems that is provided in Developing and implementing a GIS project. It also provides guidelines for determining what values to assign to a spatial reference system's parameters.

Coordinate systems, coordinates, and measures

You can think of a coordinate system in terms of an imaginary grid that covers a specific geographic area. Examples include a grid that covers the earth, a grid that covers a nation, or a grid that covers a region in a state. Each geographic feature in the area is situated at the intersection of an east-west gridline and a north-south gridline. A value, called an X coordinate, indicates where the location lies on the east-west gridline. Another value, a Y coordinate, indicates where the location lies on the north-south gridline. Both values reference the location to the grid's center, or origin.

The X and Y coordinates at the origin are both zero. From the origin eastward, X coordinates are positive; from the origin westward, they are negative. Similarly, from the origin northward, Y coordinates are positive; from the origin southward, they are negative. For an illustration of this distribution, consider the following generalized example: Coordinate system A includes a grid that covers a large metropolitan area. An X coordinate of 7 would denote a position that is seven units of measurement eastward from the origin of this grid. An X coordinate of -9.5 would denote a position that is nine and a half units of measurement westward from the origin.

Each data item in a spatial column includes either (1) an X coordinate and a Y coordinate that define the location of a geographic feature or (2) multiple X and Y coordinates that define the locations of the parts of a feature, or that define the area that a feature covers. Two other kinds of values--a Z coordinate and a measure--can also be included. Unlike X and Y coordinates, Z coordinates and measures are not used in DB2 Spatial Extender to define locations or areas. Rather, they simply convey information required by a GIS application. A Z coordinate typically indicates the height or depth of a geographic feature. Z coordinates above the origin are positive; Z coordinates below it are negative. A measure is numeric; it can convey any sort of information. For example, suppose that you are representing oil wells in your GIS. If you require your applications to process values that denote shot point IDs for seismic data, you could store these values as measures.

Spatial reference systems, offsets, and scale factors

As indicated in Coordinate systems, coordinates, and measures, coordinates can be negative and expressed in decimals. The same is true for measures. However, to reduce storage overhead, DB2 Spatial Extender stores each coordinate and measure as a non-negative integer (that is, as a positive integer or as zero). Therefore, actual negative and decimal coordinates and measures must be converted to non-negative integers, so that DB2 Spatial Extender can store them. Furthermore, you need to tell DB2 Spatial Extender how to make the conversion. You do this by setting certain parameters. Parameter settings that are to be used to convert coordinates and measures within a specific geographic area are collectively called a spatial reference system.

You can create a spatial reference system by:

Determining the lowest negative coordinates and measures

Before you set parameters for a spatial reference system, you need to determine the lowest negative X coordinate, Y coordinate, Z coordinate, and measure in the geographic area that contains the features that you want information about. You can find out what these values are by answering the following questions:

Having ascertained the lowest negative coordinates and measures, add to each one an amount equal to five to ten percent of its value. For example, if the lowest negative X coordinate is -100, you could add -5 to it. This book calls the resulting figure an augmented value.

Specifying offset factors

Next, specify what offset factors DB2 Spatial Extender should use to convert negative coordinates and measures to non-negative ones:

The offset subtracted from X coordinates is called a false X. The offsets subtracted from Y coordinates, Z coordinates, and measures are called false Y, false Z, and false M, respectively. For instructions on specifying these parameters from the Control Center, see Creating a spatial reference system from the Control Center.

Specifying scale factors

Next, specify what scale factors DB2 Spatial Extender should use to convert decimal coordinates and measures to integers:

The scale factor for X and Y coordinates is called an XY unit. The scale factors for Z coordinates and measures are called Z units and M units, respectively. For instructions on specifying these parameters from the Control Center, see Creating a spatial reference system from the Control Center.

Creating a spatial reference system from the Control Center

This section gives an overview of the steps to create a spatial reference system from the Control Center. The overview is followed by details of how to complete each step.

No authorization is required to perform these steps.

Overview of steps to create a spatial reference system from the Control Center:

  1. Open the Create Spatial Reference window.
  2. Indicate which coordinate system you want to use.
  3. Specify identifiers for the spatial reference system that you want to create.
  4. Determine what ranges of coordinates and measures apply to the geographic features that you want information about.
  5. Specify values that can be used to convert negative or decimal coordinates and measures into data items that DB2 Spatial Extender can store.
  6. Tell DB2 Spatial Extender to create the spatial reference system that you want.

Detailed steps to create a spatial reference system from the Control Center:

  1. Open the Create Spatial Reference window.
    1. From the Control Center window, expand the object tree until you find the Databases folder under the server where you want DB2 Spatial Extender to run.
    2. Click the Databases folder. The databases are displayed in the contents pane on the right side of the window.
    3. Right-click the database that you enabled for spatial data, and click Spatial Extender --> Spatial References in the pop-up menu. The Spatial References window opens.
    4. From the Spatial References window, click Create. The Create Spatial Reference window opens.
  2. From the Create Spatial Reference window, use the Coordinate system field to indicate what coordinate system you want to use.
  3. Specify identifiers for the spatial reference system that you want to create.
  4. Using a medium outside the Control Center--for example, paper or a white board--determine the lowest negative coordinates and measures that apply to the geographic features that you are representing. For guidelines on how to do this, see Determining the lowest negative coordinates and measures.
  5. From the Create Spatial Reference window, specify values to convert negative or decimal coordinates and measures into data items that DB2 Spatial Extender supports--that is, into 32-bit non-negative integers.
    1. Specify values to convert negative or decimal X coordinates into non-negative integers:
      • In the Offset column, in the field nearest to the X, specify a false X:
        • If any values within the range of X coordinates that you identified in step 4 are negative, type a false X that, when subtracted from the lowest negative coordinate, leaves a positive number. For guidelines, see Specifying offset factors.
        • If all the X coordinates are non-negative, type a false X of 0.
      • In the Scale factor column, specify an XY unit in the field to the far right of the X. This XY unit should be one that, when multiplied by any decimal X coordinate or decimal Y coordinate, yields a whole number that can be stored as a 32-bit data item, with minimum loss of precision. For guidelines, see Specifying scale factors.

        After you specify the XY unit in the field to the far right of the X, it will appear also in the field to the far right of the Y.

    2. Specify a false Y that will allow DB2 Spatial Extender to convert negative Y coordinates into positive values. You do this in the Offset column, in the field nearest to the Y:
      • If any values within the range of Y coordinates that you identified in step 4 are negative, type a false Y that, when subtracted from the lowest negative coordinate, leaves a positive number. For guidelines, see Specifying offset factors.
      • If all the Y coordinates are positive, type a false Y of 0.
    3. If you are going to include Z coordinates in your spatial data, specify values to convert negative or decimal Z coordinates into non-negative integers:
      • In the Offset column, in the field nearest to the Z, type a false Z:
        • If any values within the range of Z coordinates that you identified in step 4 are negative, type a false Z that, when subtracted from the lowest negative coordinate, leaves a positive number. For guidelines, see Specifying offset factors.
        • If all the Z coordinates are non-negative, type a false Z of 0.
      • In the Scale factor column, specify a Z unit in the field to the far right of the Z. This Z unit should be one that, when multiplied by any decimal Z coordinate, yields a whole number that can be stored as 32-bit data item, with minimum loss of precision. For guidelines, see Specifying scale factors.
    4. If you are going to include measures in your spatial data, specify values to convert negative or decimal measures into positive integers:
      • In the Offset column, in the field nearest to the Linear label, type a false M:
        • If any values within the range of measures that you identified in step 4 are negative, type a false M that, when subtracted from the lowest negative measure, leaves a positive number. For guidelines, see Specifying offset factors.
        • If all the measures are positive, type a false M of 0.
      • In the Scale factor column, specify an M unit in the field to the far right of the Linear label. This M unit should be one that, when multiplied by any decimal measure, yields a whole number that can be stored as 32-bit data item, with minimum loss of precision. For guidelines, see Specifying scale factors.
  6. Click OK to create the spatial reference system that you want.


[ Top of Page | Previous Page | Next Page ]