跳转至
🎉 SedonaDB 0.4.0 已正式发布!🗺️ 新增 Python DataFrame API、R dplyr 接口、Geography 支持及 GPU 加速空间连接。阅读发布博客 →

ST_Contains

Introduction: Tests whether geography A fully contains geography B using S2 spherical boolean operations. Returns true if every point of B is inside or on the boundary of A.

ST_Contains returning true ST_Contains returning false

Format:

ST_Contains (A: Geography, B: Geography)

Return type: Boolean

Since: v1.9.1

SQL Example

SELECT ST_Contains(
  ST_GeogFromWKT('POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))'),
  ST_GeogFromWKT('POINT (0.5 0.5)')
);

Output:

true