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

Leticia Gomez lgomez at itba.edu.ar
Mon Jan 16 10:21:45 PST 2012


Buenismo. Suerte!

Leticia


-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Havard
Tveite
Sent: lunes, 16 de enero de 2012 15:06
To: postgis-devel at postgis.refractions.net
Cc: mtnclimb at gmail.com
Subject: Re: [postgis-devel] Should EMPTY be spatially equal to self ?

On 1/16/2012 2:42 PM, Sandro Santilli wrote:
> On Sat, Jan 14, 2012 at 12:44:34AM +0100, Havard Tveite wrote:
>
>> How would you explain the result of ST_Equals(empty,empty)
>> according to point set topology?  the 9-intersection
>> model* says that "equals" has the following matrix (T:
>> non-empty, F: empty, i: interior, b: boundary, e:
>> exterior):
>>
>>     i  b  e
>> i  T  F  F
>> b  F  T  F
>> e  F  F  T
>
> As I just said to regina, the above isn't always true.
> A point has no boundary, so BB can't be T.

You are right - in the above example I was simplifying to
2D geometries in 2D space.  But I don't think that really
matters much in this context.

>> I suppose that empty geometries have an empty interior and
>> an empty boundary.  Then their exterior would be the
>> universal set.  In that case (and if the empty set is a
>> member of all sets, also for point set topology), I would
>> think that the matrix should be all T's, and that is not
>> the matrix of ST_Equals.
>
> There's no such thing as the "equals matrix".

There *is* such a thing as the "equals matrix" for 2D
geometries in 2D space.  I think the above example is valid
for 2D geometries in 2D space, and I think that it shows a
problem with returning "true" or "false" as the result when
comparing empty geometries for spatial equality.

>> So I don't think it makes sense to return anything else than
>> NULL for ST_Equals on empty geometries.
>
> The sense I see about is is that ST_Equals(A, A) should be true,
> for anything which isn't NULL. If EMPTY should be threated the
> same as NULL I don't see why we have EMPTY at all.

What I say is that I think that spatial is different, and I
have tried to show this by referring to point set topology
applied to 2D geometries in 2D space.
ST_Equals is a spatial operation, and, in my opinion,
comparing anything to to empty is nonsense in a spatial
context.

I buy the argument in Paul's document that EMPTY is kind of
logical as a result of for instance ST_Intersect and
ST_Difference.  Whether it is really useful to be able to
differentiate between NULL and EMPTY, I don't know.
I would guess that we could do without EMPTY.

>> In a practical situation, I would not like a spatial join
>> with ST_Equals as the join predicate to get matches when one
>> or both of the geometries are empty, since their spatial
>> relationship cannot be determined (in my opinion).
>
> I belive the spatial relationship of two empty geometries
> is well defined as :
>
>       i  b  e
>    i  F  F  F
>    b  F  F  F
>    e  F  F  2

I think you should justify this.  Is it not so that the
empty set is a member of all sets?  If the interior and
boundary of the empty set is the empty set, How come you
get so many F's in your matix?


Håvard
-- 
Håvard Tveite
Department of Mathematical Sciences and Technology, UMB
Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt/
_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel




More information about the postgis-devel mailing list