Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

ST_DWithin

Introduction: Returns true if 'leftGeometry' and 'rightGeometry' are within a specified 'distance'. This function essentially checks if the shortest distance between the envelope of the two geometries is <= the provided distance.

Format: ST_DWithin (leftGeometry: Geometry, rightGeometry: Geometry, distance: Double)

SQL Example:

SELECT ST_DWithin(ST_GeomFromWKT('POINT (0 0)'), ST_GeomFromWKT('POINT (1 0)'), 2.5)

Output:

true