[postgis-tickets] [PostGIS] #2634: geography regression failure ST_DWithin/ST_Distance between 2.0.4 and 2.1.2 for dimensional mix of geographies

PostGIS trac at osgeo.org
Fri Mar 7 15:49:57 PST 2014


#2634: geography regression failure ST_DWithin/ST_Distance between 2.0.4 and 2.1.2
for dimensional mix of geographies
----------------------+-----------------------------------------------------
 Reporter:  robe      |       Owner:  pramsey      
     Type:  defect    |      Status:  new          
 Priority:  critical  |   Milestone:  PostGIS 2.1.2
Component:  postgis   |     Version:  2.1.x        
 Keywords:            |  
----------------------+-----------------------------------------------------

Comment(by pramsey):

 The second case appears distinct from the first, because it's consistent,
 and the flipping is just the cache in operation. The core problem can be
 seen by setting both tree and brute force algorithms into sphere mode
 {{{
 WITH
 geogp(gid, geog) AS (VALUES
  (1, 'POINT(-11.1111111 40)'::geography),
  (1, 'POINT(-11.1111111 40)'::geography)),
 geogl (gid, geog) AS (VALUES
   (3, 'LINESTRING (-10 50,50 -10)'::geography),
   (4, 'LINESTRING (-10 50,50 -10)'::geography))

 SELECT
   geogp.gid AS p_gid,
   geogl.gid AS l_gid,
   ST_Distance(geogp.geog, geogl.geog, false) AS dist,
   _ST_DistanceUncached(geogp.geog, geogl.geog, false) AS distunc,
   _ST_DistanceTree(geogp.geog, geogl.geog) AS disttree
 FROM geogp CROSS JOIN geogl;

  p_gid | l_gid |       dist       |     distunc     |     disttree
 -------+-------+------------------+-----------------+------------------
      1 |     3 |  1010519.2194355 | 1010519.2194355 | 1011346.61455376
      1 |     4 | 1011346.61455376 | 1010519.2194355 | 1011346.61455376
      1 |     3 | 1011346.61455376 | 1010519.2194355 | 1011346.61455376
      1 |     4 | 1011346.61455376 | 1010519.2194355 | 1011346.61455376
 }}}
 They just plain disagree on the answer here (though they agree when in
 spheroid mode). The flip/flopping problem has to be something else
 (worse), I think.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2634#comment:13>
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