ST_INTERSECTS

 

Updated: February 1, 2017

Applies To: Azure

Returns 1 if a geography intersects with another. If geographies do not intersect it will return 0.

Syntax

ST_INTERSECTS (lineStringA, lineStringB)  

LineStringA

The LineString that could intersect with LineStringB.

LineStringB

The LineString that could intersect with LineStringA.

Returns 1 if a LineString intersects with another LineString, if not it will return 0.

SELECT  
     ST_INTERSECTS(input.pavedRoad, input.dirtRoad)  
FROM input  
  

Input Example

datacenterAreastormArea
{“type”:”LineString”, “coordinates”: [ [-10.0, 0.0], [0.0, 0.0], [10.0, 0.0] ]}{“type”:”LineString”, “coordinates”: [ [0.0, 10.0], [0.0, 0.0], [0.0, -10.0] ]}
{“type”:”LineString”, “coordinates”: [ [-10.0, 0.0], [0.0, 0.0], [10.0, 0.0] ]}{“type”:”LineString”, “coordinates”: [ [-10.0, 10.0], [0.0, 10.0], [10.0, 10.0] ]}

Output Example

1

0

Show: