Name

ST_DFullyWithin — Tests if a geometry is entirely inside a distance of another

Synopsis

boolean ST_DFullyWithin(geometry g1, geometry g2, double precision distance);

Beschreibung

Returns true if g2 is entirely within distance of g1. Visually, the condition is true if g2 is contained within a distance buffer of g1. The distance is specified in units defined by the spatial reference system of the geometries.

[Note]

Diese Funktion beinhaltet automatisch einen Bounding-Box-Vergleich, der alle räumlichen Indizes verwendet, die für die Geometrien verfügbar sind.

Verfügbarkeit: 1.5.0

Changed: 3.5.0 : the logic behind the function now uses a test of containment within a buffer, rather than the ST_MaxDistance algorithm. Results will differ from prior versions, but should be closer to user expectations.

Beispiele

SELECT
    ST_DFullyWithin(geom_a, geom_b, 10) AS DFullyWithin10,
    ST_DWithin(geom_a, geom_b, 10) AS DWithin10,
    ST_DFullyWithin(geom_a, geom_b, 20) AS DFullyWithin20
FROM (VALUES
    ('POINT(1 1)', 'LINESTRING(1 5, 2 7, 1 9, 14 12)')
    ) AS v(geom_a, geom_b)

 dfullywithin10 | dwithin10 | dfullywithin20
----------------+-----------+----------------
 f              | t         | t