Retrieves a named element from the Well Known Text (WKT) definition of a spatial reference system.
 Syntax
 SyntaxST_SpatialRefSys::ST_ParseWKT(element,srs-text)
 Parameters
 Parameters| Name | Type | Description | 
|---|---|---|
| element | VARCHAR(128) | The element to retrieve from the WKT. The following named elements may be retrieved: 
 | 
| srs-text | LONG VARCHAR | The spatial reference system definition text | 
 Returns
 ReturnsLONG VARCHAR Retrieves a named element from the WKT definition of a spatial reference system.
 Remarks
 RemarksRetrieves a named element from the WKT definition of a spatial reference system. If the WKT does not define the named element, NULL is returned.
The Well Known Text which describes spatial reference systems is a different format from the Well Known Text which describes geometries.
 Standards and compatibility
 Standards and compatibilitySQL/MM (ISO/IEC 13249-3: 2006) Vendor extension
 Example
 ExampleThe following example returns a result with one row for each of the named elements.
| with V(element,srs_text) as (
    SELECT row_value as element, 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]' as srs_text
    FROM sa_split_list('srs_name,srs_type,organization,organization_id,linear_unit_of_measure,linear_unit_of_measure_factor,angular_unit_of_measure,angular_unit_of_measure_factor') D
)
SELECT element, ST_SpatialRefSys::ST_ParseWKT( element, srs_text ) parsed
FROM V | 
The example returns the following result set:
| element | parsed | 
|---|---|
| srs_name | WGS 84 | 
| srs_type | GEOGRAPHIC | 
| organization | EPSG | 
| organization_id | 4326 | 
| linear_unit_of_measure | NULL | 
| linear_unit_of_measure_factor | NULL | 
| angular_unit_of_measure | degree | 
| angular_unit_of_measure_factor | .017453292519943282 | 
|  | Discuss this page in DocCommentXchange.
                   | Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |