CREATE SPATIAL REFERENCE SYSTEM Statement

Creates or replaces a spatial reference system.

Syntax

{ CREATE [ OR REPLACE ] SPATIAL REFERENCE SYSTEM 
    | CREATE SPATIAL REFERENCE SYSTEM IF NOT EXISTS } 
    srs-name 
    [ srs-attribute ] [ srs-attribute ... ]

srs-name : string

srs-attribute: 
    IDENTIFIED BY 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 } 
    | TYPE { ROUND EARTH | PLANAR } 
    | 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 } 
    | 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' 
}

Parameters

Examples

Usage

For a geographic spatial reference system, you can specify both a LINEAR and an ANGULAR unit of measure; otherwise for non-geographic, you specify only a LINEAR unit of measure. The LINEAR unit of measure is used for computing distance between points and areas. The ANGULAR unit of measure tells how the angular latitude/longitude are interpreted and is NULL for projected coordinate systems, non-NULL for geographic coordinate systems.

All derived geometries returned by operations are normalized.

When working with data that is being synchronized with a non-SQL Anywhere database, STORAGE FORMAT should be set to either 'Original' or 'Mixed' so that the original characteristics of the data can be preserved.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Requires one of: