[postgis-devel] Should EMPTY be spatially equal to self ?

'Sandro Santilli' strk at keybit.net
Mon Jan 16 05:37:22 PST 2012


On Sun, Jan 15, 2012 at 05:14:33PM -0500, Paragon Corporation wrote:
>  
> Sandro,
> 
> I thought I mentioned this already.  ST_Equals should be false for two empty
> geometries otherwise the fundamental foundation of spatial intersection we
> rely on crumbles to its knees. How do we know two things do not intersect
> because their intesection is empty space.
> 
> Let me put it another way.  ST_Equals is the same as:
> 
> SELECT ST_Relate('POINT EMPTY'::geometry, 'POINT EMPTY'::gemetry,
> 'T*F**FFF*');

This one:

    I B E
  I t * f
  B * * f
  E f f *

IB should be False, BB may be false only because some spatial types
do not have a boundary, otherwise it should be TRUE (puntual for lines
and lineal for polygons). EE should be areal (2) always.

> So only the interior of a geometry should intersect and since empty does not
> intersect with empty (the interior of empty is empty),
> it violates the fundamental rule of spatial equality.

The JTS code for Equals checks againts a few different relate matrices,
depending on input types. May as well consider "FFFFFFFF2" as equals:

    I B E
  I f f f
  B f f f
  E f f 2

No other relation would be the same as the above (interior has no intersection
with any component of the other).

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list