[postgis-devel] <<->>

Paul Ramsey pramsey at cleverelephant.ca
Fri May 22 05:28:18 PDT 2015


On May 22, 2015 at 1:48:20 AM, Sandro Santilli (strk at keybit.net) wrote:
> On Thu, May 21, 2015 at 11:15:25AM -0700, Paul Ramsey wrote:
> > I'm looking at converting this operator to do "true" KNN, just like
> > <-> now does (for PgSQL 9.5). A couple things hold me back:
> >
> > - having to renovate the regression tests to handle testing both pre-
> > and post-9.5 behaviors conditionally (yuck!)
>  
> You could have both expected files as different ones and set the
> correct one in place at ./configure time.

Stil yuck.

> Having two different operators for bounding box and real distance could
> be a minor problem, if possible. BTW, can the 9.5 "recheck" capability
> also be used to change && to be a _real_ overlap operator ? If it can,
> would it make sense from a user point of view to change the behavior so
> drastically ?

We’ve had this option for a decade, since we’ve had recheck available in filter conditions almost from the start. We’ve opted not to change the behaviour.

> > - the lack of a "true" distance4d function to apply in the case of
> > GeometryZM and GeometryM inputs. We have support for 2d, and 3dz
> > inputs, but nothing for others.
>  
> Yep.
> Defining an ND distance function for anything but points is pretty hard.
>  
> > - I could hack something up, that would fuse a true 2d or 3d
> > distance with a centroid-based distance for the M dimension

In this case, for a 4D object I’d get the 3d distance, square it, add the square of the distance of the M dimension from centroid to centroid, and sqrt that. So “kinda” like what you’d get if you ran an actual 4d distance.

> > - I could have a hybrid that does centroid distance for 3dm and 3dzm
> > but true distance for 2d and 3dz.

This would do full centroid distance (for all dimensions) for some cases, and real distance (for all supported dimensions) for others. 

> > - I could do nothing and leave the <<->> operator as it is now
>  
> It'd be nice to get real-3D distance for 3DZ inputs.
> But I don't get the difference between first and second options.


ATB
P

 



More information about the postgis-devel mailing list