[postgis-devel] ST_Union, ST_Collect and ST_Difference strictness

Darafei "Komяpa" Praliaskouski me at komzpa.net
Tue Dec 19 05:04:28 PST 2017


Hi,

Thanks for the document.
I've found just a line of RETURNS NULL ON NULL INPUT on pages 44-45.
It feels to me that this line is there as a result of copy-paste - there is
no explanation in text why it matters or should be that way.
What would be the way to get comments on this from people designing the
spec?

It does not define ST_Collect, so this behavior can be applied to it not
violating the spec.

пн, 18 дек. 2017 г. в 19:40, Daniel Baston <dbaston at gmail.com>:

> I think strictness of these functions may be specified by OGC standards...
>
> http://www.opengeospatial.org/standards/sfs
>
> Dan
>
> On Mon, Dec 18, 2017 at 9:03 AM, Darafei "Komяpa" Praliaskouski <
> me at komzpa.net> wrote:
>
>> Hi all,
>>
>> I propose to change strictness for ST_Union, ST_Collect and ST_Difference
>> to non-strict.
>>
>> It's common in my workflows to have constructs like
>>
>> ST_Difference(a.geom, (select ST_Union(geom) from clipping_table b where
>> ST_Intersects(a.geom, b.geom)))
>>
>> Right now it has not evident side effect of geometries disappearing if
>> ST_Union had no rows to collect. It surely can be fixed with coalesce, but
>> you have to first know of such behavior with NULLs. :)
>>
>> So, I propose non-strict handling of nulls:
>> ST_Union(A, NULL) => A,
>> ST_Union(NULL, A) => A,
>> ST_Union(NULL, NULL) => NULL,
>> ST_Collect(A, NULL) => A,
>> ST_Collect(NULL, A) => A,
>> ST_Collect(NULL, NULL) => NULL,
>> ST_Difference(A, NULL) = A,
>> ST_Difference(NULL, *) = NULL.
>>
>> any thoughts?
>>
>>
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20171219/090eda91/attachment.html>


More information about the postgis-devel mailing list