STGeomFromText (tipo di dati geography)
Restituisce un'istanza geography di una rappresentazione Well-Known Text (WKT) OGC (Open Geospatial Consortium), integrata con qualsiasi valore Z (innalzamento) e M (misura) appartenente all'istanza.
Sintassi
STGeomFromText ( 'geography_tagged_text' , SRID )
Argomenti
geography_tagged_text
Rappresentazione WKT dell'istanza geography da restituire. geography_tagged_text è un'espressione nvarchar(max).SRID
Espressione int che rappresenta l'identificatore SRID dell'istanza geography da restituire.
Tipi restituiti
Tipo SQL Server restituito: geography
Tipo CLR restituito: SqlGeography
Osservazioni
Il tipo OGC dell'istanza geography restituita da STGeomFromText() è impostato sull'input WKT corrispondente.
Questo metodo genererà un'eccezione FormatException se l'input non è formattato in modo corretto.
Esempi
Nell'esempio seguente viene utilizzato il metodo STGeomFromText() per creare un'istanza geography.
DECLARE @g geography;
SET @g = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656)', 4326);
SELECT @g.ToString();