STPolyFromText (geography Data Type)
Zwraca geography wystąpienie z reprezentacja OGC (Otwieranie lokalizacji geograficznych Consortium) Well-Known tekstu (WKT) rozszerzony z dowolnego Z (podniesienie) i wartości M (miara) przez wystąpienie.
STPolyFromText ( 'polygon_tagged_text' , SRID )
Argumenty
polygon_tagged_text
Is the WKT representation of the geographyPolygon instance you wish to return.polygon_tagged_text is an nvarchar(max) expression.SRID
Is an int expression representing the spatial reference ID (SRID) of the geographyPolygon instance you wish to return.
Zwracane typy
SQL Server typ zwrotny: geography
Zwracany typ CLR: SqlGeography
Typ OGC: Polygon
Remarks
Ta metoda wygeneruje FormatException Jeśli dane wejściowe nie są well-formatted.
Przykłady
W poniższym przykładzie użyto STPolyFromText() Aby utworzyć geography wystąpienie.
DECLARE @g geography;
SET @g = geography::STPolyFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326);
SELECT @g.ToString();