Generic distance calculation

Sylvain Bougerel sylvain.bougerel.devel at gmail.com
Wed Feb 18 07:53:40 UTC 2009


Hi,

I commited a new generic way of doing distance calculation for nearest
neighbor searches in paulharris/bugfixes (yeah, this is a mistake:
should have been sb/bugfixes).

The new way allow a flexible way of doing distance calculation that
should not impact performance. Moreover, it provides an interface that
support distance calculation for riemanean spaces such a the
lat/long/alt earth coordinate system (However this is not in the
code).

The other good thing about this is that I was able to compile both
test files without doing any modifications to the files, so it does
not break the code. The 'test_hayne.cpp' passed after the first
compilation, while 'test_kdtree.cpp' had to be modify a little due to
a difference in the range of 0.0000001 in the result of the distance
calculation from the double (before they where strictly identical so
== could work).

The code is still experimental, but be free to try it. Also, I have
written 2 distance calculator at the moment, anyone can add more,
providing they are generic enough.

Cheers,

Sylvain



More information about the libkdtree-devel mailing list