GeomFromGML (geography Data Type)

Construct a geography instance given a representation in the SQL Server subset of the Geography Markup Language (GML).

For more information on the Geography Markup Language, see the following Open Geospatial Consortium Specifications: OGC Specifications, Geography Markup Language

Syntax

GeomFromGml ( GML_input, SRID )

Arguments

  • GML_input
    Is an XML input from which the GML will return a value.

  • SRID
    Is an int expression representing the spatial reference ID (SRID) of the geography instance you wish to return.

Return Types

SQL Server return type: geography

CLR return type: SqlGeography

Remarks

This method throws a FormatException if the input is not well-formatted.

Examples

The following example uses GeomFromGml() to create a geography instance.

DECLARE @g geography;
DECLARE @x xml;
SET @x = '<LineString xmlns="http://www.opengis.net/gml"><posList>47.656 -122.36 47.656 -122.343</posList></LineString>';
SET @g = geography::GeomFromGml(@x, 4326);
SELECT @g.ToString();

See Also

Other Resources