[postgis-devel] Distance operator in presence of M

Sandro Santilli strk at keybit.net
Thu Jun 4 12:39:57 PDT 2015


On Thu, Jun 04, 2015 at 02:26:05PM -0400, Greg Troxel wrote:
> 
> Sandro Santilli <strk at keybit.net> writes:
> 
> >> It strikes me that the KNN stuff should be passed in a distance function
> >> rather than forcing us to define the one true distance function, but
> >> that may be enthusiasm for object orientation more than is useful.
> >
> > I don't get you here.
> 
> I meant that functions that do computations where a substep is computing
> distance should take a function as one of their arguments, and use that
> for distance, so that one can choose at runtime without having to embed
> the distance-function choice in the top-level function.  Basically lisp
> mentality and passing in a lambda, or like qsort(3).

It does (I've just learnt from Paul).

That function takes a "strategy number", which is arbitrarily defined.
We defined stragety number 13 to be operator <->, which does spatial
distance in 2 dimensions.  Likewise, we might define another strategy
number to be another operator to mean CPA distance. Exciting times !

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list