[Gstat-info] non-Euclidean distance functions?

Edzer Pebesma edzer.pebesma at uni-muenster.de
Fri Mar 14 08:27:11 CET 2008


It can be done at the C code level only. In data.h you'll find three 
functions,

   double (*point_norm)(const DPOINT *); /* eucl. vector length */
   double (*pp_norm2)(const DPOINT *, const DPOINT *); /* point-point 
squared distance */
   double (*pb_norm2)(const DPOINT *, BBOX); /* point-BBOX distance: 
nsearch.c */

that a DATA structure needs; they are set in data.c. They are used to 
compute distances. See how they're set currently; you would have to 
override them with your own versions. The question of course is whether 
the input arguments provide sufficient information to compute your 
distance.

Another option I can see is non-linearly transformating your space to a 
space where you can use the Euclidian distance measure, then 
back-transforming.
--
Edzer

Carlos Rueda wrote:
> Hello list,
>
> I'm just starting to look into gstat to see the feasibility of
> incorporating user-defined distance functions to compute models and do
> interpolation. I already searched the gstat-info archives but it seems
> this aspect hasn't been discussed here. I'm not an expert in
> geostatistical analysis but, according to some references(*), it would
> be sufficient that the distance function be a valid metric. Is this
> correct? If so, can anyone provide some hints regarding the parts in
> the source code that would have to be modified? (I already have
> glanced over the code and have a preliminary approach that I can
> discuss off-list.)
>
>    (*) - http://www.mail-archive.com/ai-geostats@jrc.it/msg03008.html
>         - A geostatistical approach for describing spatial pattern in
> stream networks.
>           Ganio, Torgersen, Gresswell. Frontiers in Ecology and the
> Environment. 2005
>
> Thanks!
>
> Carlos Rueda
> Postdoctoral Researcher
> Center for Spatial Technologies and Remote Sensing
> University of California, Davis
> _______________________________________________
> Gstat-info mailing list
> Gstat-info at geo.uu.nl
> http://mailman.geo.uu.nl/mailman/listinfo/gstat-info
>   



More information about the Gstat-info mailing list