[postgis-users] GeometryCollection(Empty) is SRID dependent (or supporting nulls in st_union)

Charlie Savage cfis at savagexi.com
Sat Sep 27 13:32:21 PDT 2008



Brent Wood wrote:
> That gets back to how nulls should be handled generally. 
> 
> If you take the sum() (or avg(), max(), etc) of a numeric column with nulls, what should the result be?

In postgresql, nulls are ignored. To see this, run this query:

select sum(numbers.value), avg(numbers.value), max(numbers.value)
from
(select 1 as value
union
select null as value) as numbers

The results are:

sum  avg                     max
   1  1.00000000000000000000   1

> Is an empty geometry value different from a null in a geometry column? 

I'll leave that to other to decide - but I don't see why a null geometry 
is tied to a SRID.

> Can an empty geometry have a SRID (& a null can't)?

A null geometry does have an SRID which is the root of the problem.

Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080927/63638216/attachment.bin>


More information about the postgis-users mailing list