[postgis-devel] Distance operator in presence of M

Paul Ramsey pramsey at cleverelephant.ca
Thu Jun 4 05:13:04 PDT 2015


I certainly wouldn’t cry if <<->> only did 2- or 3-d distance and skipped the fourth d-. It’s ugly code anyways, and like you say, it doesn’t have a great deal of meaning, since the 4th dimension isn’t in the same space as the first 3

P 


--  
http://postgis.net  
http://cleverelephant.ca


On June 4, 2015 at 1:31:53 AM, Sandro Santilli (strk at keybit.net) wrote:
> As you may have noticed, I'm working on adding some functions to work
> with "trajectories". These are linestrings in which each point corresponds
> to the location of an object at a given time. Location uses XYZ, time uses M.
>  
> The "closest points" between two trajectories are those in which the two
> moving objects are spatially closest at the same point in time.
>  
> The ST_ClosestPointOfApproach function, which I committed in r13569,
> returns such point in time.
>  
> Now, when it comes to the <<->> operator, for geometry or geography, we
> have to pick a distance semantic in case of M presence. Right now this
> semantic is just discarding M, compute in 2d or 3d space (whatever is
> available in both operands) and then "add" the M difference to the euclidean
> distance.
>  
> https://trac.osgeo.org/postgis/ticket/3133
>  
> But I'm wondering, is current approach any useful ?
> Would using the ClosestPointOfApproach semantic, in presence of M,
> ruin any other valid use case for <<->> ?
>  
> While we can encode semantic in the function name for functions, with
> operators we have a limited expressibility, so if <<->> has to be
> used for pure euclidean distance we'd need another operator name for
> the CPA semantic, and, I suppose, another operator class to make use
> of KNN with that semantic.
>  
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>  




More information about the postgis-devel mailing list