[postgis-devel] assumptions of &&& operator for missing dimensions

Rémi Cura remi.cura at gmail.com
Tue Feb 24 08:32:54 PST 2015


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

Cheers,
Rémi-C

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 ?
>
> --strk;
>
>   ()   Free GIS & Flash consultant/developer
>   /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20150224/e7ea56c4/attachment.html>


More information about the postgis-devel mailing list