Calculating offset values

Specify offset values if your coordinate data includes negative numbers or measures. An offset is a number that is subtracted from all coordinates, leaving only positive values as a remainder.

About this task

If you create a spatial reference system and your coordinate data includes negative numbers or measures, you must specify the offset values that you want to use. You can improve the performance of spatial operations when the coordinates are positive integers instead of negative numbers or measures.

Procedure

To calculate the offset values for the coordinates that you are working with:

  1. Determine the lowest negative X, Y, and Z coordinates within the range of coordinates for the locations that you want to represent. If your data is to include negative measures, determine the lowest of these measures.
  2. Optional but recommended: Indicate to Db2® Spatial Extender that the domain that encompasses the locations that you are concerned with is larger than it actually is. Thus, after you write data about these locations to a spatial column, you can add data about locations of new features as they are added to outer reaches of the domain, without having to replace your spatial reference system with another one.

    For each coordinate and measure that you identified in step 1, add an amount equal to five to ten percent of the coordinate or measure. The result is referred to as an augmented value. For example, if the lowest negative X coordinate is -100, you could add -5 to it, yielding an augmented value of -105. Later, when you create the spatial reference system, you will indicate that the lowest X coordinate is -105, rather than the true value of -100. Db2 Spatial Extender will then interpret -105 as the westernmost limit of your domain.

  3. Find a value that, when subtracted from your augmented X value, leaves zero; this is the offset value for X coordinates. Db2 Spatial Extender subtracts this number from all X coordinates to produce only positive values.

    For example, if the augmented X value is -105, you need to subtract -105 from it to get 0. Db2 Spatial Extender will then subtract -105 from all X coordinates that are associated with the features that you are representing. Because none of these coordinates is greater than -100, all the values that result from the subtraction will be positive.

  4. Repeat step 3 for the augmented Y value, augmented Z value, and augmented measure.