跳转至
Apache Sedona 1.9.0 已正式发布,新增 Spark 4.1 支持、proj4sedona 坐标系转换、Bing Tile 函数等众多特性!

ST_Intersects

Introduction: Tests whether two geography objects intersect on the sphere using S2 spherical boolean operations. Returns true if A and B share any portion of space (including a single boundary point), and false if they are fully disjoint.

Edges are interpreted as great-circle arcs, so the test is correct even when geographies cross the antimeridian or wrap around the poles — situations where a planar ST_Intersects would be wrong.

ST_Intersects returning true ST_Intersects returning false

Format:

ST_Intersects (A: Geography, B: Geography)

Return type: Boolean

Since: v1.9.1

SQL Example — overlapping polygons:

SELECT ST_Intersects(
  ST_GeogFromWKT('POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0))', 4326),
  ST_GeogFromWKT('POLYGON ((1 1, 3 1, 3 3, 1 3, 1 1))', 4326)
);

Output:

true

SQL Example — disjoint polygons:

SELECT ST_Intersects(
  ST_GeogFromWKT('POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))', 4326),
  ST_GeogFromWKT('POLYGON ((10 10, 11 10, 11 11, 10 11, 10 10))', 4326)
);

Output:

false