STRelate (geometry Data Type)
Applies To: SQL Server 2014, SQL Server 2016 Preview
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
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.
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****');