Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 2.11 KB

File metadata and controls

60 lines (46 loc) · 2.11 KB
title STGeomCollFromWKB (geometry Data Type)
description STGeomCollFromWKB (geometry Data Type)
author MladjoA
ms.author mlandzic
ms.date 08/03/2017
ms.service sql
ms.subservice t-sql
ms.topic reference
ms.custom
ignite-2024
f1_keywords
STGeomCollFromWKB (geometry Data Type)
STGeomCollFromWKB_TSQL
helpviewer_keywords
STGeomCollFromWKB (geometry Data Type)
dev_langs
TSQL

STGeomCollFromWKB (geometry Data Type)

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

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

Syntax

  
STGeomCollFromWKB ( 'WKB_geometrycollection' , SRID )  

Arguments

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 geometry instance you wish to return.

Return Types

[!INCLUDEssNoVersion] return type: geometry

CLR return type: SqlGeometry

Remarks

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

This method will throw a FormatException exception if the input isn't well formatted.

Examples

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

DECLARE @g geometry;  
SET @g = geometry::STGeomCollFromWKB(0x0107000000020000000103000000010000000400000000000000000014400000000000001440000000000000244000000000000014400000000000002440000000000000244000000000000014400000000000001440010100000000000000000024400000000000002440, 0);  
SELECT @g.STAsText();  

See Also

OGC Static Geometry Methods