[SciPy-User] KD Tree with great circle distances

David Hoese dhoese at gmail.com
Sun May 20 12:26:52 EDT 2018


Hi Ashwin,

As far as I know this is the easiest way to do it. I'm not a scipy 
developer, but you may be interested in the pyresample package:

http://pyresample.readthedocs.io/en/latest/

Which uses the pykdtree library:

https://github.com/storpipfugl/pykdtree

And can perform resampling of irregularly spaced data. For certain 
calculations/utilities it will also convert to XYZ space as described in 
that SO answer. Hope this helps a little, sorry if it isn't the answer 
you're looking for.

Dave

On 5/20/18 11:09 AM, ashwin .D wrote:
> Hello,
>             I am using - 
> https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.KDTree.html#scipy.spatial.KDTree 
> which  I believe is using Euclidean distances underneath the hood. But I 
> want to be able to use great circle distances. Is this the only way to 
> do this - 
> https://stackoverflow.com/questions/20654918/python-how-to-speed-up-calculation-of-distances-between-cities 
> or is there some way I can extend that class to use great circle 
> distances(maybe somebody has already done that ? ) I have a irregular 
> shaped grid in a WGS 84 ellipsoid(can be assumed to be a sphere) and so 
> I want to use great circle distances or if somebody can convince me not 
> to that would be great as well.
> 
> 
> Best regards,
> Ashwin.
> 
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at python.org
> https://mail.python.org/mailman/listinfo/scipy-user
> 


More information about the SciPy-User mailing list