STPolyFromText (geometry Data Type)
Zwraca geometry 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 geometryPolygon 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 geometryPolygon instance you wish to return.
Zwracane typy
SQL Server typ zwrotny: geometry
Zwracany typ CLR: SqlGeometry
Typ OGC: Polygon
Remarks
Ta metoda spowoduje wygenerowanie FormatException Jeśli dane wejściowe nie są well-formatted.
Przykłady
W poniższym przykładzie użyto STPolyFromText() Aby utworzyć geometry wystąpienie.
DECLARE @g geometry;
SET @g = geometry::STPolyFromText('POLYGON ((5 5, 10 5, 10 10, 5 5))', 0);
SELECT @g.ToString();