Export (0) Print
Expand All

GeomFromGml (geometry Data Type)


Applies To: SQL Server 2014, SQL Server 2016 Preview

Construct a geometry 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

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.

GeomFromGml ( GML_input, SRID )


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


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

SQL Server return type: geometry

CLR return type: SqlGeometry

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

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

DECLARE @g geometry;
DECLARE @x xml;
SET @x = '<LineString xmlns="http://www.opengis.net/gml"> <posList>100 100 20 180 180 180</posList> </LineString>';
SET @g = geometry::GeomFromGml(@x, 0);
SELECT @g.ToString();
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft