[postgis-devel] ST_Union, ST_Collect and ST_Difference strictness

Daniel Baston dbaston at gmail.com
Mon Dec 18 08:40:17 PST 2017


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20171218/54ec6604/attachment.html>


More information about the postgis-devel mailing list