[PostGIS] #5828: Performace issue in ST_DFullyWithin

PostGIS trac at osgeo.org
Mon Jan 6 15:30:48 PST 2025


#5828: Performace issue in ST_DFullyWithin
----------------------+---------------------------
  Reporter:  nbvfgh   |      Owner:  pramsey
      Type:  defect   |     Status:  closed
  Priority:  medium   |  Milestone:  PostGIS 3.6.0
 Component:  postgis  |    Version:  3.5.x
Resolution:  fixed    |   Keywords:
----------------------+---------------------------
Comment (by mdavis):

 In general
 {{{
 ST_DFullyWithin(A, B, R)
 }}}
 and
 {{{
 ST_MaxDistance(ST_ClosestPoint(A, B), B) ⇐ R
 }}}
 are NOT equivalent.

 A counter-example is:
 {{{
 WITH data(a, b) AS (VALUES
   ('LINESTRING (0 0, 0 9)'::geometry, 'LINESTRING( 1 0, 2 9)'::geometry)
 )
 SELECT ST_DFullyWithin(a, b, 3.0),
   ST_MaxDistance(ST_ClosestPoint(a, b), b)
   FROM data;
 }}}

 The maximum distance of the closest point is ~ 9.2, but B is fully within
 < 3 units of A.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5828#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list