ST_WITHIN (Azure 串流分析)

如果地理位置在另一個地理位置內,則傳回 1,如果沒有,則會傳回 0。

Syntax

ST_WITHIN (geography, polygon)  

引數

地理位置

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

Polygon

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

傳回類型

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

範例

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

輸入範例

deliveryDestination warehouse
{“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

另請參閱