[postgis-devel] Changing ST_Expand(geometry) to return LINESTRING

Sandro Santilli strk at keybit.net
Thu Feb 26 01:30:41 PST 2015

I was looking for a way to expand a 4D point to use the resulting
"nd-box"  in an ND overlap query (&&&) and found the closest function
to do that being ST_Expand(geometry).

That function reurns a geometry of type POLYGON, but I'm thinking..
what's the POLYGON representation for a 3D or 4D box ?
Having 5 vertices makes it completely arbitrary where to put
the MIN and the MAX values of each ordinate.

Wouldn't it be less confusing to return a 2-vertices LINESTRING
instead ?

As noted in http://trac.osgeo.org/postgis/ticket/1329
a 2-vertices LINESTRING might be the closest thing to
an even less confusing "BOXND" type. It has a direction
(contrary to a MULTIPOINT) that makes it clear what the
min and max are (first and last points).

Or would you prefer to have a new "BOX" geometry type  ?
Or even a new "BOXND" PostgreSQL type ?


More information about the postgis-devel mailing list