Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements


Changes the settings of an existing spatial reference system. See the Remarks section for considerations before altering a spatial reference system.

[ srs-attribute [ srs-attribute ... ] ]
srs-name : string
srs-attribute :
SRID srs-id
| DEFINITION { definition-string | NULL }
| ORGANIZATION { organization-name IDENTIFIED BY organization-srs-id | NULL }
| TRANSFORM DEFINITION { transform-definition-string | NULL }
| LINEAR UNIT OF MEASURE linear-unit-name
| ANGULAR UNIT OF MEASURE { angular-unit-name | NULL }
| COORDINATE coordinate-name { UNBOUNDED | BETWEEN low-number AND high-number }  
| ELLIPSOID SEMI MAJOR AXIS semi-major-axis-length { SEMI MINOR AXIS semi-minor-axis-length | INVERSE FLATTENING inverse-flattening-ratio }
| SNAP TO GRID { grid-size | DEFAULT }
| TOLERANCE { tolerance-distance | DEFAULT }
| AXIS ORDER axis-order
| POLYGON FORMAT polygon-format
| STORAGE FORMAT storage-format
srs-id : integer
semi-major-axis-length : number
semi-minor-axis-length : number
inverse-flattening-ratio : number
grid-size : DOUBLE : usually between 0 and 1
tolerance-distance : number
axis-order :  { 'x/y/z/m' | 'long/lat/z/m' | 'lat/long/z/m' }
polygon-format : { 'CounterClockWise' | 'Clockwise' | 'EvenOdd' }
storage-format : { 'Internal' | 'Original' | 'Mixed' }

Complete definitions for each of the clauses is provided in the CREATE SPATIAL REFERENCE SYSTEM statement.

  • IDENTIFIED BY clause

    Use this clause to change the SRID number for the spatial reference system.

  • DEFINITION clause

    Use this clause to set, or override, default coordinate system settings.


    Use this clause to specify information about the organization that created the spatial reference system that the spatial reference system is based on.


    Use this clause to specify a description of the transform to use for the spatial reference system. Currently, only the PROJ.4 transform is supported.

    The transform definition is used by the ST_Transform method when transforming data between spatial reference systems. Some transforms may still be possible even if there is no transform-definition-string defined.

  • COORDINATE clause

    Use this clause to specify the bounds on the spatial reference system's dimensions. coordinate-name is the name of the coordinate system used by the spatial reference system. For non-geographic types coordinate-name can be x, y, or m. For geographic types, coordinate-name can be LATITUDE, LONGITUDE, z, or m.


    Use this clause to specify the linear unit of measure for the spatial reference system. The value you specify must match a linear unit of measure defined in the ST_UNITS_OF_MEASURE consolidated view.


    Use this clause to specify the angular unit of measure for the spatial reference system. The value you specify must match an angular unit of measure defined in the ST_UNITS_OF_MEASURE consolidated view.

  • TYPE clause

    Use the TYPE clause to control how the spatial reference system interprets lines between points. For geographic spatial reference systems, the TYPE clause can specify either ROUND EARTH (the default) or PLANAR. For non-geographic spatial reference systems, the type must be PLANAR.

  • ELLIPSOID clause

    Use the ellipsoid clause to specify the values to use for representing the Earth as an ellipsoid for spatial reference systems of type ROUND EARTH. If the DEFINITION clause is present, it can specify ellipsoid definition. If the ELLIPSOID clause is specified, it overrides this default ellipsoid.

  • SNAP TO GRID clause

    For flat-Earth (planar) spatial reference systems, use the SNAP TO GRID clause to define the size of the grid the database server uses when performing calculations. Specify SNAP TO GRID DEFAULT to set the grid size to the default that the database server would use.

    For round-Earth spatial reference systems, SNAP TO GRID must be set to 0.

  • TOLERANCE clause

    For flat-Earth (planar) spatial reference systems, use the TOLERANCE clause to specify the precision to use when comparing points.

    For round-Earth spatial reference systems, TOLERANCE must be set to 0.


    Use the POLYGON FORMAT clause to change the polygon interpretation. The following values are supported:

    • 'CounterClockwise'
    • 'Clockwise'
    • 'EvenOdd'

    The default polygon format is 'EvenOdd'.


    Use the STORAGE FORMAT clause to control what is stored when spatial data is loaded into the database. Possible values are:

    • 'Internal'

      The database server stores only the normalized representation. Specify this when the original input characteristics do not need to be reproduced. This is the default for planar spatial reference systems (TYPE PLANAR).

      Note If you are using MobiLink to synchronize your spatial data, you should specify Mixed instead. MobiLink tests for equality during synchronization, which requires the data in its original format.
    • 'Original'

      The database server stores only the original representation. The original input characteristics can be reproduced, but all operations on the stored values must repeat normalization steps, possibly slowing down operations on the data.

    • 'Mixed'

      The database server stores the internal version and, if if the internal version is different from the original version, the original version as well. By storing both versions, the original representation characteristics can be reproduced and operations on stored values do not need to repeat normalization steps. However, storage requirements may increase significantly because potentially two representations are being stored for each geometry.

      Mixed is the default format for round-Earth spatial reference systems (TYPE ROUND EARTH).


You cannot alter a spatial reference system if there is existing data that references it. For example, if you have a column declared as ST_Point(SRID=8743), you cannot alter the spatial reference system with SRID 8743. This is because many spatial reference system attributes, such as storage format, impact the storage format of the data. If you have data that references the SRID, create a new spatial reference system and transform the data to the new SRID.

If you use this statement in a procedure, do not specify the password (IDENTIFIED BY clause) as a string literal because the definition of the procedure is visible in the SYSPROCEDURE system view. For security purposes, specify the password using a variable that is declared outside of the procedure definition.


You must be the owner of the spatial reference system, or have one of the following privileges:

  • ALTER privilege on the spatial reference system
  • MANAGE ANY SPATIAL OBJECT system privilege
  • ALTER ANY OBJECT system privilege
Side effects


  • ANSI/ISO SQL Standard

    Not in the standard.


The following example changes the polygon format of a fictitious spatial reference system named mySpatialRef to EvenOdd.