共用方式為


ST_OVERLAPS

✅ Azure 串流分析 ✅ 網狀架構事件串流

如果 geography 與另一個地理位置重疊,則傳回 1。 如果地理位置沒有重疊,或其中一個位於另一個地理位置內,則會傳回 0。

語法

ST_OVERLAPS (polygonA, polygonB)  

論點

PolygonA

可以與多邊形B 重疊的多邊形。

PolygonB

可能會與多邊形重疊的多邊形A。

返回類型

如果多邊形與另一個多邊形重疊,則傳回 1,如果不是,則會傳回 0。

範例

SELECT  
     ST_OVERLAPS(input.datacenterArea, input.stormArea)  
FROM input  
  

輸入範例

datacenterArea stormArea
{“type”:“Polygon”, “coordinates”: [ [0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0] ]} {“type”:“Polygon”, “coordinates”: [ [30.0, 30.0], [40.0, 30.0], [40.0, 40.0], [30.0, 40.0], [30.0, 30.0] ]}
{“type”:“Polygon”, “coordinates”: [ [0.0, 0.0], [20.0, 0.0], [20.0, 20.0], [0.0, 20.0], [0.0, 0.0] ]} {“type”:“Polygon”, “coordinates”: [ [10.0, 10.0], [40.0, 10.0], [40.0, 40.0], [40.0, 20.0], [40.0, 40.0] ]}

輸出範例

0

1

另請參閱