[postgis-devel] EMPTY

Havard Tveite havard.tveite at umb.no
Fri Oct 9 01:44:17 PDT 2009


I think that geometry EMPTY should be treated more like NULL
than 0.  0 has a position in one-dimensional space, while an
EMPTY geometry does not have any position in space (whatever
dimension).

So, in my opinion, all spatial predicates involving an empty
geometry should return NULL (even if this is counter to the
behaviour of a spatial DBMS developed by very smart people ;-) ).
That includes ST_Relate.

By using anything else that NULL, I think we will get into all
sorts of trouble, as the wiki indicates.

Håvard Tveite

Chris Hodgson wrote:
> EMPTY will get used because it is the result of some spatial operations, 
> ie. a empty intersection or difference. I think this is the primary 
> consideration for the handling of empty geometries, ie. that subsequent 
> chained operations or comparisons can operate on the an empty result in 
> a way that doesn't require special handling. eg. a query like this:
> 
> SELECT * FROM a JOIN b JOIN c WHERE st_intersects( st_intersection( 
> a.geom, b.geom ), c.geom );
> 
> I would dare say that geometry empty is more like zero, than null. The 
> SQL null value is different from the GEOMETRY EMPTY in that EMPTY is an 
> expected result of a successful, valid, operation, where null generally 
> is not, save for operations that are specifically designed to deal with 
> nulls.
> 
> Chris
> 
> Martin Davis wrote:
>> One note on your semantics.  I think that
>>
>> ST_Intersects( empty, empty ) == FALSE
>>
>> The motivation for this is that EMPTY in the spatial realm is 
>> analogous to NULL in the SQL realm.  If there's nothing there, you 
>> can't determine anything about it.
>>
>> Although really I don't think any of this matters all that much, 
>> absent any clear use case for using EMPTY.
>>
>> Paul Ramsey wrote:
>>> I've started a page on the semantics of empty. Please feel free to add
>>> cases, clarify and discuss...
>>>
>>> http://trac.osgeo.org/postgis/wiki/DevWikiEmptyGeometry
>>>
>>> P.

-- 
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/



More information about the postgis-devel mailing list