db2se alter_srs command

The db2se alter_srs command updates a spatial reference system definition.

You can use this command to change the offset, scale, or coordinate system name of a spatial reference system. The information about the coordinate system is available through the DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS catalog view.

Authorization

The user ID must have DBADM and DATAACCESS authority on the spatially enabled database to run this command.

Command syntax

db2se alter_srs command

Read syntax diagramSkip visual syntax diagramalter_srsdatabase_name-userIduser_id-pwpassword -srsNamesrs_name -srsIdsrs_id-xOffsetx_offset-xScalex_scale-yOffsety_offset-yScaley_scale-zOffsetz_offset-zScalez_scale-mOffsetm_offset-mScalem_scale-coordsysNamecoordsys_name-descriptiondescription_string

Command parameters

Where:
database_name
Specifies the name of the database for which you want to update a spatial reference system definition.
-userId user_id
Specifies the database user ID that has DATAACCESS authority on the database indicated by database_name.
-pw password
Specifies the password for user_id.
-srsName srs_name
Identifies the spatial reference system that you want to update. The srs_name value is converted to uppercase unless you enclose it in double quotation marks.
-srsId srs_id
Uniquely identifies the spatial reference system. This identifier is used as an input parameter for various spatial functions.
-xOffset x_offset
Specifies the offset for all X coordinates of geometries that are represented in this spatial reference system. The offset is subtracted before the x_scale scale factor is applied when geometries are converted to the Db2® Spatial Extender internal representation from external representations such as, well-known text(WKT), well-known binary (WKB), and shape.
-xScale x_scale
Specifies the scale factor for all X coordinates of geometries that are represented in this spatial reference system. The scale factor is applied (multiplication) after the x_offset offset is subtracted when geometries are converted to the Db2 Spatial Extender internal representation from external representations such as, WKT, WKB, and shape.
-yOffset y_offset
Specifies the offset for all Y coordinates of geometries that are represented in this spatial reference system. The offset is subtracted before the y_scale scale factor is applied when geometries are converted to the Db2 Spatial Extender internal representation from external representations such as, WKT, WKB, and shape.
-yScale y_scale
Specifies the scale factor for all Y coordinates of geometries that are represented in this spatial reference system. The scale factor is applied (multiplication) after the y_offset offset is subtracted when geometries are converted to the Db2 Spatial Extender internal representation from external representations such as, WKT, WKB, and shape. This scale factor must be the same as x_scale.
-zOffset z_offset
Specifies the offset for all Z coordinates of geometries that are represented in this spatial reference system. The offset is subtracted before the z_scale scale factor is applied when geometries are converted to the Db2 Spatial Extender internal representation from external representations such as, WKT, WKB, and shape.
-zScale z_scale
Specifies the scale factor for all Z coordinates of geometries that are represented in this spatial reference system. The scale factor is applied (multiplication) after the z_offset offset is subtracted when geometries are converted to the Db2 Spatial Extender internal representation from external representations such as, WKT, WKB, and shape.
-mOffset m_offset
Specifies the offset for all M coordinates of geometries that are represented in this spatial reference system. The offset is subtracted before the m_scale scale factor is applied when geometries are converted to the Db2 Spatial Extender internal representation from external representations such as, WKT, WKB, and shape.
-mScale m_scale
Specifies the scale factor for all M coordinates of geometries that are represented in this spatial reference system. The scale factor is applied (multiplication) after the m_offset offset is subtracted when geometries are converted to the Db2 Spatial Extender internal representation from external representations such as, WKT, WKB, and shape.
-coordsysName coordsys_name
Uniquely identifies the coordinate system on which this spatial reference system is based. The coordinate system must be listed in the view DB2GSE.ST_COORDINATE_SYSTEMS.

The coordsys_name value is converted to uppercase unless you enclose it in double quotation marks. The maximum length for this parameter is 128 characters.

-description description_string
Describes the coordinate system by explaining its application. The maximum length for this parameter is 256 characters.

Usage notes

If you use this command 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.

Examples

The following example alters a spatial reference system named MYSRS with a different description.


db2se alter_srs mydb -srsName mysrs 
        -description "This is my own spatial reference system."

The following example alters a spatial reference system named MYSRS_35 with a different xOffset and description because there is no spatial data that uses MYSRS_35. If you have spatial using it, the data becomes unusable.


db2se alter_srs mydb -srsName mysrs_35 -xOffset 35 
        -description "This is my own spatial reference system with xOffset=35."