[postgis-tickets] [PostGIS] #2422: geography regression difference ST_DWithin

PostGIS trac at osgeo.org
Mon Aug 12 07:13:51 PDT 2013


#2422: geography regression difference ST_DWithin
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  high     |   Milestone:  PostGIS 2.1.0
Component:  postgis  |     Version:  2.1.x        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by robe):

 I think the ST_Distance cache is fine.

 I created this function which uses _ST_Distance instead of _ST_DWithin.  I
 frankly don't see why we even bother creating an _ST_DWithin
 (geography_dwithin) when the distance function takes a tolerance.
 {{{

 CREATE OR REPLACE FUNCTION st_dwithin2(geography, geography, double
 precision, boolean)
   RETURNS boolean AS
 'SELECT $1 && _ST_Expand($2,$3) AND $2 && _ST_Expand($1,$3) AND
 _st_distance($1, $2, $3, $4) <= $3'
   LANGUAGE sql IMMUTABLE
   COST 100;
 }}}

 I run this query:

 {{{
 SELECT count(id) FROM face
 WHERE ST_DWithin2(geog, st_setsrid(st_makepoint(-71.0636, 42.3584),
 4326)::geography, 1609.344,true );
 ;

 }}}


 And voila -- get my expected answer:


 {{{
  count
 -------
    397
 }}}


 Anyway I would like this issue resolved today so I can release today
 otherwise I'll have to weigh and maybe release tomorrow.  In meantime I'll
 finish doing garden regress against 2.0.4 and hopefully I won't find any
 other issues.

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