[SciPy-User] kdtree, custom distance function

denis denis-bz-gg@t-online...
Fri Nov 18 05:39:32 CST 2011


Oleksandr,
  a general method is to map lat long <-> x,y,z on the sphere,
build a kdtree on the 3 coordinates,
map near neighbors in xyz back to lat long.
Euclidean distance between two points xyz and x'y'z' is not great-
circle distance
but should be near enough ?
(This is from Bentley p. 92, http://cm.bell-labs.com/cm/cs/pearls).

cheers
  -- denis

On Nov 14, 6:05 pm, Oleksandr Huziy <guziy.sa...@gmail.com> wrote:
> Hello,
>
> I am trying to use scipy.spatial.kdtree to interpolate data from a lat/lon
> grid to a set of points (also with lat/lon coordinates).
>
> Is it possible to specify a custom distance function for the kdtree that
> should be used for querying?


More information about the SciPy-User mailing list