STMPolyFromWKB (geography Data Type)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

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

Syntax

  
STMPolyFromWKB ( 'WKB_multipolygon' , SRID )  

Arguments

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

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

Return Types

SQL Server return type: geography

CLR return type: SqlGeography

OGC type: MultiPolygon

Examples

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

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

See Also

OGC Static Geography Methods