Skip to content

ST_DWithin

Returns true if two geometries are within a specified distance of each other.

Usage

boolean ST_DWithin(geomA: geometry, geomB: geometry, distance: double)

Arguments

  • geomA (geometry): Input geometry
  • geomB (geometry): Input geometry
  • distance (double)

Examples

SELECT ST_DWithin(
  ST_Point(0.25, 0.25),
  ST_GeomFromText('POLYGON ((0 0, 1 0, 0 1, 0 0))'),
  0.5
);
┌──────────────────────────────────────────────────────────────────────────────┐
│ st_dwithin(st_point(Float64(0.25),Float64(0.25)),st_geomfromtext(Utf8("POLYG │
│                  ON ((0 0, 1 0, 0 1, 0 0))")),Float64(0.5))…                 │
╞══════════════════════════════════════════════════════════════════════════════╡
│ true                                                                         │
└──────────────────────────────────────────────────────────────────────────────┘