Export (0) Print
Expand All

STGeomCollFromWKB (geography Data Type)

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


STGeomCollFromWKB ( 'WKB_geometrycollection' , SRID )

WKB_geometrycollection

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

SRID

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

SQL Server return type: geography

CLR return type: SqlGeography

The OGC type of the geography instance returned by STGeomCollFromWKB() is set to GeometryCollection, MultiPolygon, MultiLineString, or MultiPoint, depending on the corresponding WKB input.

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

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

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

Community Additions

ADD
Show:
© 2014 Microsoft