Returns the GML representation of an ST_Geometry value.
geometry-expression.ST_AsGML([ format])
Name | Type | Description |
---|---|---|
format |
VARCHAR(128) |
A string defining the parameters to use when converting the geometry-expression to a GML representation. If not specified, the default is 'GML'. |
LONG VARCHAR Returns the GML representation of the geometry-expression.
The ST_AsGML method returns a GML string representing the geometry. A number of different formats are supported (with associated options) and the desired format is selected using the optional format parameter. If the format parameter is not specified, the default is 'GML'.
The format string defines an output format and parameters to the format. The format string has one of the following formats:
format-name |
format-name(parameter1=value1;parameter2=value2;...) |
parameter1=value1;parameter2=value2;... |
The first format specifies the format name and no parameters. All format parameters use their default values. The second format specifies the format name and a list of named parameter values. Parameters that are not supplied use their default values. The last format specifies only parameter values, and the format name defaults to 'GML'.
The following format names may be used:
GML The Geography Markup Language format defined by ISO 19136 and the OGC.
The following format parameters can be specified:
Format Name | Parameter Name | Default Value | Allowed Values | Description |
---|---|---|---|---|
GML | Namespace | none |
|
The namespace parameter specifies the output format convention for namespace. |
GML | SRSNameFormat | short |
|
The SRSNameFormat parameter specifies the format for the srsName attribute. |
GML | SRSDimension | No | Yes or No | The SRSDimension parameter specifies the number of coordinate values for the given geometry. This only applies to GML(version=3). |
GML | SRSFillAll | No | Yes or No | The SRSFillAll parameter specifies whether or not SRS attributes should be propagated to child geometry elements. As an example a MultiGeometry or MultiPolygon would propagate the attributes to its child geometries. |
GML | UseDeprecated | No | Yes or No | The UseDeprecated parameter only applies to GML(version=3). It is used to output older GML representations where possible. As an example a Surface may be output as a Polygon if the geometry contains no CircularStrings. |
GML | Attribute | Automatically generated optional attributes | One or more attributes may be specified for the top level geometry element only | Any legal XML attributes may be specified. |
GML | SubElement | Automatically generated GML sub elements | One or more sub elements may be specified for the top level geometry element only | Any legal XML elements may be specified. |
By default, ST_AsGML uses the original format for a geometry, if it is available. Otherwise, the internal format is used. For more information about internal and original formats, see STORAGE FORMAT clause, CREATE SPATIAL REFERENCE SYSTEM statement.
SQL/MM (ISO/IEC 13249-3: 2006) 5.1.39
The following example returns the result <Point srsName="EPSG:4326"><pos>1 2 3 4</pos></Point>
.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsGML() |
The following example returns the result <Point srsName="EPSG:4326"><coordinates>1,2</coordinates></Point>
.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsGML('GML(Version=2)') |
The following returns the result <gml:Point srsName="EPSG:4326"><gml:coordinates>1,2</gml:coordinates></gml:Point>
.
The Namespace=global parameter provides a dedicated ("gml") prefix for the given element and its sub elements.
This is useful when the query is used within an aggregate operation, such that, some top level element defines
the namespace for the "gml" prefix.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsGML('GML(Version=2;Namespace=global)') |
The following returns the result <Point srsName="EPSG:4326"><coordinates>1,2</coordinates></Point>
.
No namespace information is included in the output.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsGML('GML(Version=2;Namespace=none)') |
The following returns the result <Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"><coordinates>1,2</coordinates></Point>
.
The long format of the srsName attribute is used.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsGML('GML(Version=2;Namespace=none;SRSNameFormat=long)') |
The following returns the result <Point srsName="urn:x-ogc:def:crs:EPSG:4326"><pos>1 2 3 4</pos></Point>
.
The long format of the srsName attribute is used and the format differs in version 3 from the version 2 format.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsGML('GML(Version=3;Namespace=none;SRSNameFormat=long)') |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |