[postgis-devel] EMPTY is as EMPTY does?

Sandro Santilli strk at keybit.net
Wed Jun 24 12:55:45 PDT 2015


On Wed, Jun 24, 2015 at 11:45:24AM -0700, Paul Ramsey wrote:
> Found another one, lurking in the depths of EMPTY
> 
>   select st_astext('MULTILINESTRING(EMPTY,EMPTY)'::geometry::bytea::geometry);
> 
> returns 
> 
>   MULTILINESTRING EMPTY
> 
> Basically our WKB emitter short-circuits on anything that answers true to lwgeom_is_empty() and emits a simple empty of the parent type. So it’s not possible to dump/restore a table that contains a collection empty.

Which constraint would that fail ? Your example above has a MULTILINESTRING
in and a MULTILINESTRING out, sounds "safe" (although struct-breaking).

> In related news, gserialized_is_empty doesn’t currently handle collections of empty, it’ll return true for those, unlike lwgeom_is_empty. This is causing some inconsistent results…

I think it makes sense for "is_empty" to return true for a set
of empties organized in any way.

--strk;



More information about the postgis-devel mailing list