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

Paragon Corporation lr at pcorp.us
Tue Jan 17 01:15:49 PST 2012


> > According to the SF definition of Equals (TFF.FTF.FFT) this 
> means that 
> > Equals(EMPTY, EMPTY) = false.  Maybe not the most desirable 
> result in 
> > some situations, but it's good to be consistent.  After all, that's 
> > the whole reason for defining the predicates in terms of 
> the DE9IM in the first place.
> 
> Speaking of consistency, this is the DE9IM of a point to itself:
> 
>        0FF.FFF.FF2
> 
> It doesn't match the SF definition of Equals (B/B is false).
> Should a point not be equal to itself for the sake of being 
> consistent ?

Strk -- where are you getting these definitions from?

 ST_Equals is T*F.**F.FF*

Clearly a point satisfies that.  The only True intersection condition
absolutely required for 
equality is that the interiors MUST intersect.  An empty geometry interior
does not intersect with empty geometry interior

because by definition -- 2 geometries intersect if the intersection is not
empty space.
You love documentation so much -- its written right here in our docs --
http://www.postgis.org/documentation/manual-svn/using_postgis_dbmanagement.h
tml#DE-9IM
F => empty set


I think the best way to resolve this is ot just do what the other spatial
databases do assuming they all do the same.
Just need some people to test SQL Server and Oracle.

Keep in mind that spatial equality is VERY different from geometry equality.

spatial equality: Do 2 geometries occupy the same space?  -- NO (invalid
geometries also are not equal because
there space is not well defined) (empty geometry = F)
geometric equality: Do 2 containers contain the same geometry? 
 -- empty geometry -- YES (probably if they are the same typed empty,
probably false if they are not), invalid geometries - yes

Thanks,
Regina





More information about the postgis-devel mailing list