Skip to content

Latest commit

 

History

History
67 lines (49 loc) · 1.9 KB

geomfromgml-geometry-data-type.md

File metadata and controls

67 lines (49 loc) · 1.9 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom f1_keywords helpviewer_keywords dev_langs
GeomFromGml (geometry Data Type)
GeomFromGml (geometry Data Type)
MladjoA
mlandzic
08/03/2017
sql
t-sql
reference
ignite-2024
GeomFromGML_TSQL
GeomFromGML
GeomFromGML (geometry Data Type)
TSQL

GeomFromGml (geometry Data Type)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

Construct a geometry instance given a representation in the [!INCLUDEssNoVersion] 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 geometry instance you wish to return.

Return Types

[!INCLUDEssNoVersion] return type: geometry

CLR return type: SqlGeometry

Remarks

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

Examples

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();  

See Also

Extended Static Geometry Methods