[postgis-devel] [PostGIS] #884: Unstable results from ST_Within

PostGIS trac at osgeo.org
Fri Mar 25 11:02:26 PDT 2011


#884: Unstable results from ST_Within
---------------------+------------------------------------------------------
 Reporter:  strk     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  high     |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by robe):

 Just to add to strk -- me too, and see ST_DWithin works fine and since
 ST_Within works fine with just one record, and I don't think ST_DWithin
 uses prepared geometry, that rules out Geos and any weirdness in
 PostgreSQL.  So I'm guessing prepared geometry hashing.  Check this out:


 {{{
 select gid, ST_IsValid(the_geom), ST_Within(ST_GeomFromText('POINT
 (-115.04252 36.05137)',  -1), the_geom) from foo_reload where gid !=2;


  gid | st_within
 -----+-----------
    1 | f
    3 | t
 }}}



 {{{
 select gid, ST_NPoints(the_geom),
 ST_Distance(the_geom,ST_GeomFromText('POINT (-115.04252 36.05137)',  -1))
 As dist , ST_DWithin(ST_GeomFromText('POINT (-115.04252 36.05137)',  -1),
 the_geom,0.0000001) from foo_reload

  gid | st_npoints |        dist         | st_dwithin
 -----+------------+---------------------+------------
    1 |        111 |   0.149589748004329 | f
    2 |        342 | 0.00350800000001072 | f
    3 |       2916 |                   0 | t

 }}}

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