[postgis-devel] ST_Union, ST_Collect and ST_Difference strictness

Paul Ramsey pramsey at cleverelephant.ca
Mon Dec 18 07:54:19 PST 2017


EMPTY are capable of carrying SRID around:

select st_srid(st_setsrid('POINT EMPTY'::geometry, 23));

The use case you describe is a textbook use of EMPTY, in fact why the
whole gnarly (and deeply inconvenient) concept exists at all.

P


On Mon, Dec 18, 2017 at 7:51 AM, Darafei "Komяpa" Praliaskouski
<me at komzpa.net> wrote:
>>
>> NULL is for "unknown", while what you're after is an EMPTY
>> How about seeing if ST_Union(geom) can return an EMPTY when passed
>> nothing ?
>
>
> For EMPTY that is made from ST_Union of zero rows, you don't have a SRID.
> You can in theory allow operations between an empty of different SRID, but
> you cannot store it a column that has a SRID.
>
> I think both proposals are good in terms of user experience, but as long as
> SRID is part of geometry body, but not header, your does not seem simple to
> implement.
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel


More information about the postgis-devel mailing list