[postgis-tickets] [PostGIS] #4081: ST_DWithin using spheroid does not calculate distance properly for geography

PostGIS trac at osgeo.org
Tue Jul 24 10:24:10 PDT 2018


#4081: ST_DWithin using spheroid does not calculate distance properly for
geography
----------------------+---------------------------
  Reporter:  amc6     |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 2.4.5
 Component:  postgis  |    Version:  2.4.x
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by pramsey):

 Aha, it's not the distance calculation, it's the index call, so all the
 uncached calls work fine, since they avoid the SQL index wrapper, but the
 calls to ST_DWithin include the index optimization, which is returning the
 wrong answer:
 {{{
 select
 a && _ST_Expand(b,111155.5) as index_b_11155_5,
 b && _ST_Expand(a,111155.5) as index_a_11155_5,
 a && _ST_Expand(b,111155.6) as index_b_11155_6,
 b && _ST_Expand(a,111155.6) as index_a_11155_6
 from (
         select ST_GeogFromText('SRID=4326;POINT(1.0 2.0)') as a,
 ST_GeogFromText('SRID=4326;POINT(1.0 1.0)') as b
 ) as points
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4081#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