ST_ALTER_SRS procedure

Use this stored procedure to update a spatial reference system definition in the database. When this stored procedure is processed, information about the spatial reference system is updated in the SYSGEO.ST_SPATIAL_REFERENCE_SYSTEMS catalog view.

Internally, the database stores the coordinate values as positive integers. Thus during computation, the impact of rounding errors (which are heavily dependent on the actual value for floating-point operations) can be reduced. Performance of the spatial operations can also improve significantly.

Restriction: You cannot alter a spatial reference system if a registered spatial column uses that spatial reference system.
Attention: Use care with this stored procedure. If you use this stored procedure to change offset, scale, or coordsys_name parameters of the spatial reference system, and if you have existing spatial data that is associated with the spatial reference system, you might inadvertently change the spatial data. If spatial data is affected, you are responsible for ensuring that the changed spatial data is still accurate and valid.

Authorization

The user ID under which the stored procedure is invoked must have SYSGEOADM authority.

Syntax

Altering scale or offset values (version 1)
Read syntax diagramSkip visual syntax diagramST_ALTER_SRS(srs_id,x_offsetnull,y_offsetnull,xy_scalenull,z_offsetnull,z_scalenull,m_offsetnull,m_scalenulldescriptionnull)
Altering scale, offset and coordinate system values (version 2)
Read syntax diagramSkip visual syntax diagramST_ALTER_SRS(srs_id,x_offsetnull,y_offsetnull,xy_scalenull,z_offsetnull,z_scalenull,m_offsetnull,m_scalenull,coordsys_namenull,organizationnull,organization_coordsys_idnulldefinitionnulldescriptionnull)

Parameter descriptions

srs_id
Uniquely identifies the spatial reference system to be altered. You must specify a non-null value for this parameter. This identifier is used as an input parameter for various spatial functions.

The data type of this parameter is INTEGER.

x_offset
Specifies the offset for all X coordinates of geometries that are represented in this spatial reference system. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the value for this parameter in the definition of the spatial reference system is not changed.

The offset is subtracted before the scale factor x_scale is applied when geometries are converted from external formats (WKT, WKB, shape, etc.) to an internal format.

The data type of this parameter is DOUBLE.

y_offset
Specifies the offset for all Y coordinates of geometries that are represented in this spatial reference system. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the value for this parameter in the definition of the spatial reference system is not changed.

The offset is subtracted before the scale factor y_scale is applied when geometries are converted from external formats (WKT, WKB, shape, etc.) to an internal format.

The data type of this parameter is DOUBLE.

xy_scale
Specifies the scale factor for all X and Y coordinates of geometries that are represented in this spatial reference system. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the value for this parameter in the definition of the spatial reference system is not changed.

The scale factor is applied (multiplication) after the offset is subtracted when geometries are converted from external formats (WKT, WKB, shape, etc.) to an internal format.

The data type of this parameter is DOUBLE.

z_offset
Specifies the offset for all Z coordinates of geometries that are represented in this spatial reference system. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the value for this parameter in the definition of the spatial reference system is not changed.

The offset is subtracted before the scale factor z_scale is applied when geometries are converted from external formats (WKT, WKB, shape, etc.) to an internal format.

The data type of this parameter is DOUBLE.

z_scale
Specifies the scale factor for all Z coordinates of geometries that are represented in this spatial reference system. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the value for this parameter in the definition of the spatial reference system is not changed.

The scale factor is applied (multiplication) after the offset z_offset is subtracted when geometries are converted from external formats (WKT, WKB, shape, etc.) to an internal format.

The data type of this parameter is DOUBLE.

m_offset
Specifies the offset for all M coordinates of geometries that are represented in this spatial reference system. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the value for this parameter in the definition of the spatial reference system is not changed.

The offset is subtracted before the scale factor m_scale is applied when geometries are converted from external formats (WKT, WKB, shape, etc.) to an internal format.

The data type of this parameter is DOUBLE.

m_scale
Specifies the scale factor for all M coordinates of geometries that are represented in this spatial reference system. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the value for this parameter in the definition of the spatial reference system is not changed.

The scale factor is applied (multiplication) after the offset m_offset is subtracted when geometries are converted from external formats (WKT, WKB, shape, etc.) to an internal format.

The data type of this parameter is DOUBLE.

coordsys_name
Uniquely identifies the coordinate system on which this spatial reference system is based. The coordinate system must be listed in the view ST_COORDINATE_SYSTEMS. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the coordinate system that is used for this spatial reference system is not changed.

The coordsys_name value is converted to uppercase unless you enclose it in double quotation marks.

The data type of this parameter is VARCHAR(128).

organization
Names the organization that defined the coordinate system and provided the definition for it; for example, "European Petroleum Survey Group (EPSG)." Although you must specify a value for this parameter, the value can be null.

If this parameter is null, the organization_coordsys_id parameter must also be null. If this parameter is not null, the organization_coordsys_id parameter cannot be null; in this case, the combination of the organization and organization_coordsys_id parameters uniquely identifies the coordinate system.

The data type of this parameter is VARCHAR(128).

organization_coordsys_id
Specifies a numeric identifier. The entity that is specified in the organization parameter assigns this value. This value is not necessarily unique across all coordinate systems. Although you must specify a value for this parameter, the value can be null.

If this parameter is null, the organization parameter must also be null. If this parameter is not null, the organization parameter cannot be null; in this case, the combination of the organization and organization_coordsys_id parameters uniquely identifies the coordinate system.

The data type of this parameter is INTEGER.

definition
Defines the coordinate system. You must specify a non-null value for this parameter. The vendor that supplies the coordinate system usually provides the information for this parameter.

The data type of this parameter is VARCHAR(2048).

description
Describes the spatial reference system by explaining its application. Although you must specify a value for this parameter, the value can be null. If this parameter is null, the description information about the spatial reference system is not changed.

The data type of this parameter is VARCHAR(256).

Example

This example uses a Db2® CALL command to change the description value of a spatial reference system named with spatial reference system id (SRS_ID) 1000:

call ST_ALTER_SRS(1000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'new SRS description')