Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 2.12 KB

strelate-geometry-data-type.md

File metadata and controls

62 lines (48 loc) · 2.12 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom f1_keywords helpviewer_keywords dev_langs monikerRange
STRelate (geometry Data Type)
STRelate (geometry Data Type)
MladjoA
mlandzic
03/14/2017
sql
t-sql
reference
ignite-2024
STRelate (geometry Data Type)
STRelate_TSQL
STRelate (geometry Data Type)
TSQL
=azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric

STRelate (geometry Data Type)

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

Returns 1 if a geometry instance is related to another geometry instance, where the relationship is defined by a Dimensionally Extended 9 Intersection Model (DE-9IM) pattern matrix value; otherwise, returns 0.

Syntax

  
.STRelate ( other_geometry, intersection_pattern_matrix )  

Arguments

other_geometry
Is another geometry instance to compare against the instance on which STRelate() is invoked.

intersection_pattern_matrix
Is a string of type nchar(9) encoding acceptable values for the DE-9IM pattern matrix device between the two geometry instances.

Remarks

This method always returns null if the spatial reference IDs (SRIDs) of the geometry instances do not match. This method will throw an ArgumentException if the matrix isn't well formed.

Return Types

[!INCLUDEssNoVersion] return type: bit

CLR return type: SqlBoolean

Examples

The following example uses STRelate() to test two geometry instances for spatial disjoint using an explicit DE-9IM pattern.

DECLARE @g geometry;  
DECLARE @h geometry;  
SET @g = geometry::STGeomFromText('LINESTRING(0 2, 2 0, 4 2)', 0);  
SET @h = geometry::STGeomFromText('POINT(5 5)', 0);  
SELECT @g.STRelate(@h, 'FF*FF****');  

See Also

OGC Methods on Geometry Instances