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

RS_Intersects

Introduction: Returns true if raster or geometry on the left side intersects with the raster or geometry on the right side. The convex hull of the raster is considered in the test.

RS_Intersects

Rules for testing spatial relationship:

  • If the raster or geometry does not have a defined SRID, it is assumed to be in WGS84.
  • If both sides are in the same CRS, then perform the relationship test directly.
  • Otherwise, both sides will be transformed to WGS84 before the relationship test.

Format:

RS_Intersects(raster: Raster, geom: Geometry)

RS_Intersects(geom: Geometry, raster: Raster)

RS_Intersects(raster0: Raster, raster1: Raster)

Return type: Boolean

Since: v1.5.0

SQL Example

SELECT RS_Intersects(RS_MakeEmptyRaster(1, 20, 20, 2, 22, 1), ST_SetSRID(ST_PolygonFromEnvelope(0, 0, 10, 10), 4326)) rast_geom,
    RS_Intersects(RS_MakeEmptyRaster(1, 20, 20, 2, 22, 1), RS_MakeEmptyRaster(1, 10, 10, 1, 11, 1)) rast_rast

Output:

+---------+---------+
|rast_geom|rast_rast|
+---------+---------+
|     true|     true|
+---------+---------+