[postgis-devel] assumptions of &&& operator for missing dimensions
Sandro Santilli
strk at keybit.net
Tue Feb 24 08:41:53 PST 2015
On Tue, Feb 24, 2015 at 05:32:54PM +0100, Rémi Cura wrote:
> 2015-02-24 17:29 GMT+01:00 Sandro Santilli <strk at keybit.net>:
>
> > On Tue, Feb 24, 2015 at 05:06:34PM +0100, Rémi Cura wrote:
> > > 2015-02-24 17:05 GMT+01:00 Sandro Santilli <strk at keybit.net>:
> >
> > > > How about overlap then ? Should they overlap or not ?
> > > >
> > > > 'POINT Z (0 0 10)' &&& 'POINT (0 0)'
> > > >
> > > > That's were we started, original question was,
> > > > which one do you prefer:
> > > >
> > > > 1. Missing dimension is unknown, return NULL
> > > > 2. Missing dimension is infinite, overlaps everything
> > > > 3. Missing dimension is empty, overlaps nothing
> > > > 4. An impossible comparison was requested, raise exception
> > >
> > >
> > > Clearly 2 for me !
> >
> > So do you also agree with ST_3DDistance('POINT Z (0 0 10)', 'POINT (0 0)')
> > returning 0 instead of 10 as done now ?
>
> Yep.
> If you use a 3D function with 2D arg, it behaves like 2D (casting to common
> type).
>
> If you want to be sure to have 3D, force 3D !
> ST_3DDistance(ST_Force3D('POINT Z (0 0 10)'), ST_Force3D('POINT (0 0)')))
> -> 10
Other opinions ?
Paul, Regina ?
Meanwhile, I filed it:
http://trac.osgeo.org/postgis/ticket/3056
We missing an ST_NDDistance, btw, do we want it or shall we rather
use ST_Distance for that, tellign users to ST_Force2D if they
want a different behavior ?
--strk;
More information about the postgis-devel
mailing list