[postgis-devel] Distance operator in presence of M

Sandro Santilli strk at keybit.net
Thu Jun 4 12:37:59 PDT 2015


On Thu, Jun 04, 2015 at 11:00:41AM -0700, Paul Ramsey wrote:
> Yes, I’d cry, because then KNN won’t work. You’d have to also
> figure out how to implement a closest approach model that works on index
> keys, such that the closest-approach distance between two keys was always
> less than the same distance between two actual objects. 

That shouldn't be a big problem.

Time can only make the minimum distance between two trajectories _larger_
than it is in space. That is, while spatial only minimum distance is the
distance between any point in one geometry to any point in another,
spatio-temporal one reduces the possible pairs to only those points having
the same T (M) value.

So by only computing the spatial distance between keys (discarding M)
would already ensure it is less (or equal) than the same distance between
any two actual objects below those keys. Maybe not optimal, but should work.

--strk;



More information about the postgis-devel mailing list