[R-sig-Geo] R: Thanks to all: Distances in geoR package

giovanna jona lasinio giovanna.jonalasinio at uniroma1.it
Fri Jun 17 15:44:54 CEST 2005


I'd be, of course, very interested! The problem I'm facing now involves
data on the adriatic sea, but the final task is to build models of waves
climatology for the entire mediterranean... I'd love to do that in R
instead of asking one of my collaborators to re-program all the
exploratory analysis in C :-)

Giovanna


-----Messaggio originale-----
Da: Roger Bivand [mailto:Roger.Bivand at nhh.no] 
Inviato: venerdì, 17. giugno 2005 15:23
A: Paulo Justiniano Ribeiro Jr
Cc: giovanna jona lasinio; r-sig-geo at stat.math.ethz.ch
Oggetto: Re: [R-sig-Geo] Thanks to all: Distances in geoR package


On Fri, 17 Jun 2005, Paulo Justiniano Ribeiro Jr wrote:

> A few words more on this.
> 
> My feeling is that the best way to handle this is with coordinate 
> trasformation (for instance for UTM) and then backtransform at the  
> end if required.
> 

And a couple more ...

Which way to go depends on the relative scale of the phenomena of 
interest. For up to hundreds of km, the distortions introduced by 
projecting to UTM or other suitable projections are small. But at 
continental scales, working with Great Circle distances for building 
distance matrices is a much better choice, not depending on the origin
of 
the projection. 

I've had C code in spdep for some time to do GC (an if() on a flag
passed through .Call to choose between the R built-in pythag() or the GC
distance). I've put a copy in the spgwr package, but multiple copies
means maintenance problems. The rdist.earth() function in fields is at
the R level - the nice comment on the help page does hold: "Surprisingly
this [is] all done efficiently in S".

I'd like to expose the GC function in the sp package, but have not yet
looked at how contributed packages can share functions (and header
files) at the C level - the header file is the real issue, I think.
Would there be interest in doing this? The GC function as it is does not
have an R wrapper, because in spdep, most of the distances are thrown
away immediately as being beyond threshold.

Feedback, please?

Roger

> There were a few messages along these lines and I will take the 
> opportunity to mention that there is a package under development (aRT)

> which intends to provide this and other functionalities typical from 
> GIS systems via Terralib The package page is: 
> http://www.est.ufpr.br/aRT
> 
> Still changing rapidly but already some functionalities are already 
> working. There is a package vignette and a few exemples in the tests 
> directory. This package adheres the the "sp" classes andin newer 
> versions also allows "proj4".
> 
> Best
> P.J.
> 
> 
> 
> On Fri, 17 Jun 2005, giovanna jona lasinio wrote:
> 
> > Dear all, thanks for the many suggestions, I'll try and let you know

> > what worked best. Package fields works well in computing variogram's

> > cloud with lon-lat coordinates (returns by default distances in 
> > miles) and usually I use a loess-built curve to get a nice-looking 
> > version of the variogram. However I wasn't able to use the "vgram" 
> > function's output in order to obtain a "variofit" estimated model. 
> > What would be extremely usefull, in my opinion, is to allow "variog"

> > to accept a distance matrix as input, in this way no coordinate 
> > transformation would be needed. I'm not yet good enough at 
> > programming in R to find a good solution myself :-) but if I find a 
> > solution I'll let you know....
> >
> > Best
> > Giovanna Jona Lasinio
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at stat.math.ethz.ch 
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> >
> 
> Paulo Justiniano Ribeiro Jr
> LEG (Laboratório de Estatística e Geoinformação)
> Departamento de Estatística
> Universidade Federal do Paraná
> Caixa Postal 19.081
> CEP 81.531-990
> Curitiba, PR  -  Brasil
> Tel: (+55) 41 3361 3573
> Fax: (+55) 41 3361 3141
> e-mail: paulojus at est.ufpr.br
> http://www.est.ufpr.br/~paulojus
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch 
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list