Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 1.79 KB

stpolyfromwkb-geography-data-type.md

File metadata and controls

59 lines (44 loc) · 1.79 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
STPolyFromWKB (geography Data Type)
STPolyFromWKB (geography Data Type)
MladjoA
mlandzic
07/30/2017
sql
t-sql
reference
STPolyFromWKB_TSQL
STPolyFromWKB (geography Data Type)
STPolyFromWKB method
TSQL

STPolyFromWKB (geography Data Type)

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

Returns a geographyPolygon instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation.

Syntax

  
STPolyFromWKB ( 'WKB_polygon' , SRID )  

Arguments

WKB_polygon
Is the WKB representation of the geographyPolygon instance you wish to return. WKB_polygon is a varbinary(max) expression.

SRID
Is an int expression representing the spatial reference ID (SRID) of the geographyPolygon instance you wish to return.

Return Types

[!INCLUDEssNoVersion] return type: geography

CLR return type: SqlGeography

OGC type: Polygon

Remarks

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

Examples

The following example uses STPolyFromWKB() to create a geography instance.

DECLARE @g geography;   
SET @g = geography::STPolyFromWKB(0x01030000000100000005000000F4FDD478E9965EC0DD24068195D3474083C0CAA145965EC0508D976E12D3474083C0CAA145965EC04E62105839D44740F4FDD478E9965EC04E62105839D44740F4FDD478E9965EC0DD24068195D34740, 4326);  
SELECT @g.ToString();  

See Also

OGC Static Geography Methods