[postgis-devel] [PostGIS] #253: Gist causes wrong result from ~=

PostGIS trac at osgeo.org
Fri Oct 2 06:30:52 PDT 2009


#253: Gist causes wrong result from ~=
----------------------+-----------------------------------------------------
  Reporter:  nicklas  |       Owner:  pramsey      
      Type:  defect   |      Status:  new          
  Priority:  medium   |   Milestone:  postgis 1.5.0
 Component:  postgis  |     Version:  1.4.X        
Resolution:           |    Keywords:               
----------------------+-----------------------------------------------------
Comment (by robe):

 I agree with you, but not sure its worthwhile to remove the RECHECK for
 this. There are a couple of problems with using ST_Equals and
 ST_OrderEquals which I am sure Kevin and I have brought up before -- and
 may be in bug list somewhere.

 The ST_Equals doesn't use a spatial index.  Yes we should consider this a
 bug

 CREATE OR REPLACE FUNCTION st_equals(geometry, geometry)
   RETURNS boolean AS
 '$libdir/postgis-1.5', 'geomequals'
   LANGUAGE 'c' IMMUTABLE STRICT
   COST 1;

 I personally never use ST_Equals when speed is a concern because of that
 reason or without an &&.  I think we might actually have this in somewhere
 as bug that Kevin posted.


 And that ain't really the same thing anyway.  ST_Equals doesn't care about
 directionality and uses intersection matrix (so really a spatial equality
 so to speak) so is not a true geometry equality operator where as
 st_geometry_same is closer to true geometric equality.

 It is more equivalent to ST_OrderingEquals which hmm although it appears
 to use a spatial index (the ordering is sometimes wrong I think so its
 slower than using ~=).  It should just be using the explicit
 ST_Geometry_Same function (which shouldn't have an ST in front of it BTW)
 :).

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/253#comment:13>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS


More information about the postgis-devel mailing list