Skip to main content
Tests whether two geographies are within a given geodesic distance (in meters) of each other on the sphere. The minimum great-circle distance between any two points on the two geographies is compared against the threshold; the test is inclusive (returns true when the minimum distance equals the threshold). ST_DWithin returning true ST_DWithin returning false

Signatures

Parameters

Geography
required
The first geography.
Geography
required
The second geography.
Double
required
The maximum geodesic distance, in meters.

Return type

true if A and B are within distance meters of each other.

Example

The same pair of points with a tighter threshold: