共用方式為


ST_WITHIN

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

如果 geography 位於另一個內,則傳回 1,如果不是,則會傳回 0。

語法

ST_WITHIN (geography, polygon)  

論點

地理

可能位於多邊形內的地理位置。 可以是點或多邊形。

多邊形

可包含地理位置的多邊形。

返回類型

如果某個點或多邊形位於另一個多邊形內,則傳回 1,如果不是,則傳回 0。

範例

SELECT  
     ST_WITHIN(input.deliveryDestination, input.warehouse)  
FROM input  
  

輸入範例

deliveryDestination 倉儲
{“type”:“Point”, “coordinates”: [76.6, 10.1]} {“type”:“Polygon”, “coordinates”: [[ [0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0] ]] }
{“type”:“Point”, “coordinates”: [15.0, 15.0]} {“type”:“Polygon”, “coordinates”: [[ [10.0, 10.0], [20.0, 10.0], [20.0, 20.0], [10.0, 20.0], [10.0, 10.0] ]] }

輸出範例

0

1

另請參閱