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.
- 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
Command parameters
- Specifies the name of the database for which you want to create a spatial reference system definition.
- Specifies the database user ID that has DATAACCESS authority on the database indicated by database_name.
- Specifies the password for user_id.
- 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.
- Uniquely identifies the spatial reference system. This identifier is used as an input parameter for various spatial functions.
- Specifies the minimum X coordinate value for all geometries that use the specified spatial reference system.
- 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.
- 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.
- 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.
- Specifies the minimum Y coordinate value for all geometries that use the specified spatial reference system.
- 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.
- 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.
- 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.
- Specifies the minimum Z coordinate value for all geometries that use the specified spatial reference system.
- 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.
- 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.
- 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.
- Specifies the minimum M coordinate value for all geometries that use the specified spatial reference system.
- 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.
- 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.
- 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.
- 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.
- 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
db2se create_srs mydb -srsName mysrs -srsID 100
-xOffset -180 -xScale 1000000 -yOffset -90
-coordsysName \"GCS_North_American_1983\"