db2se create_srs command

The db2se create_srs command creates a spatial reference system.

You can use this command to create a spatial reference system definition. A spatial reference system is defined by the coordinate system, the precision, and the extents of coordinates that are represented in the specified spatial reference system. The extents are the minimum and maximum coordinate values for the X, Y, Z, and M coordinates. The information about the coordinate system is available through the DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS catalog view.

This command has two methods of creating spatial reference systems:
  • Using conversion factors (offsets and scale factors)
  • Using extents and precision (conversion factors are calculated)

Authorization

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

Command syntax

db2se create_srs command (using conversion factors)

Read syntax diagramSkip visual syntax diagramcreate_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

db2se create_srs command (using extents and precision)

Read syntax diagramSkip visual syntax diagramcreate_srsdatabase_name-userIduser_id-pwpassword -srsNamesrs_name -srsIdsrs_id-xMinx_min -xMaxx_max -xScalex_scale -yMiny_min -yMaxy_max -yScaley_scale-zMinz_min -zMaxz_max -zScalez_scale-mMinm_min -mMaxm_max -mScalem_scale-coordsysNamecoordsys_name -descriptiondescription_string

Command parameters

Where:
database_name
Specifies the name of the database for which you want to create 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 create. 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.
-xMin x_min
Specifies the minimum X coordinate value for all geometries that use the specified spatial reference system.
-xMax x_max
Specifies the maximum X coordinate value for all geometries that use the specified spatial reference system. Depending on the x_scale value, the maximum X coordinate value returned by the DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS view might be larger than the value specified by x_max. The value returned by the view is correct.
-xOffset x_offset
Specifies the offset for all X coordinates of geometries that are represented in the specified 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 the specified 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.
-yMin y_min
Specifies the minimum Y coordinate value for all geometries that use the specified spatial reference system.
-yMax y_max
Specifies the maximum Y coordinate value for all geometries that use the specified spatial reference system. Depending on the y_scale value, the maximum Y coordinate value returned by the DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS view might be larger than the y_max value specified. The value returned by the view is correct.
-yOffset y_offset
Specifies the offset for all Y coordinates of geometries that are represented in the specified 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 the specified 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.
-zMin z_min
Specifies the minimum Z coordinate value for all geometries that use the specified spatial reference system.
-zMax z_max
Specifies the maximum Z coordinate value for all geometries that use the specified spatial reference system. Depending on the z_scale value, the maximum Z coordinate value returned by the DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS view might be larger than the z_max value specified. The value returned by the view is correct.
-zOffset z_offset
Specifies the offset for all Z coordinates of geometries that are represented in the specified 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 the specified 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.
-mMin m_min
Specifies the minimum M coordinate value for all geometries that use the specified spatial reference system.
-mMax m_max
Specifies the maximum M coordinate value for all geometries that use the specified spatial reference system. Depending on the m_scale value, the maximum M coordinate value returned by the DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS view might be larger than the m_max value specified. The value returned by the view is correct.
-mOffset m_offset
Specifies the offset for all M coordinates of geometries that are represented in the specified 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 the specified 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 the specified 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.

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

Usage notes

Db2 Spatial Extender includes support for five spatial reference systems and over 4000 coordinate systems that you can choose from. Creating a spatial reference system is rarely necessary.

Examples

The following example creates a spatial reference system named MYSRS by using the command syntax for conversion factors.
db2se create_srs mydb -srsName mysrs -srsID 100 
        -xOffset -180 -xScale 1000000 -yOffset -90 
        -coordsysName \"GCS_North_American_1983\"