[postgis-devel] [PostGIS] #1958: ST_Intersects(geography) returns incorrect result when called multiple times

PostGIS trac at osgeo.org
Tue Aug 21 05:34:28 PDT 2012


#1958: ST_Intersects(geography) returns incorrect result when called multiple
times
---------------------------+------------------------------------------------
 Reporter:  realityexists  |       Owner:  pramsey      
     Type:  defect         |      Status:  new          
 Priority:  medium         |   Milestone:  PostGIS 2.1.0
Component:  postgis        |     Version:  2.0.x        
 Keywords:                 |  
---------------------------+------------------------------------------------

Comment(by robe):

 Weird does this happen to you too?  I'm testing r10191 on PostgreSQL
 9.2beta3, compiled by Visual C++ build 1600, 32-bit

 {{{
 WITH segment_line AS
 (

         SELECT 1 AS id, 'LINESTRING(22.88333 41.96667,24.876111
 42.053361)'::geography AS line
         UNION ALL
         SELECT 2 AS id, 'LINESTRING(22.88333 41.96667,21.32667
 42.13667)'::geography AS line
         UNION ALL
         SELECT 3 AS id,  'LINESTRING(22.88333 41.96667,21.32667
 42.13667)'::geography AS line

 )
 , borders AS
 (
         SELECT 'POLYGON((22.94472 41.34667,22.87528 41.99028,22.87389
 41.98472,22.87472 41.98333,22.94472 41.34667))'::geography AS border
 )
 SELECT id, ST_Intersects(line, border), ST_Distance(line,border),
 _ST_DistanceTree(line,border)
 FROM segment_line, borders

 WHERE id IN( 2,3)
 }}}

 2 and 3 should clearly give the same answer since they are the same
 geometry and hmm they don't.  Something definitely screwy with the cache
 logic.


 {{{
  id | st_intersects |  st_distance   | _st_distancetree
 ----+---------------+----------------+------------------
   2 | t             |              0 |   452.5945844566
   3 | f             | 452.5945844566 |   452.5945844566
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1958#comment:4>
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-devel mailing list