GeomFromGML (tipo di dati geography)
Costruisce un'istanza geography data una rappresentazione nel subset SQL Server di Geography Markup Language (GML).
Per ulteriori informazioni su GML, vedere le specifiche Open Geospatial Consortium (OGC): Geography Markup Language.
Questo metodo con tipo di dati geography supporta le istanze FullGlobe o le istanze spaziali con dimensioni maggiori di un emisfero.
Sintassi
GeomFromGml ( GML_input, SRID )
Argomenti
GML_input
Input XML da cui GML restituirà un valore.SRID
Espressione int che rappresenta l'identificatore SRID dell'istanza geography da restituire.
Tipi restituiti
SQL Server tipo restituito: geography
Tipo CLR restituito: SqlGeography
Osservazioni
Questo metodo genera un'eccezione FormatException se l'input non è formattato in modo corretto.
Questo metodo genererà un'eccezione ArgumentException se l'input contiene un bordo opposto.
Esempi
Nell'esempio seguente viene utilizzato il metodo GeomFromGml() per creare un'istanza geography.
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();
Nell'esempio seguente viene utilizzato il metodo GeomFromGml() per creare un'istanza geography di FullGlobe.
DECLARE @g geography;
DECLARE @x xml;
SET @x = '<FullGlobe xmlns="https://schemas.microsoft.com/sqlserver/2011/geography" />';
SET @g = geography::GeomFromGml(@x, 4326);
SELECT @g.ToString();