Dear list,

Anyone would have a clue on how to find the two nearest locations included
within a dataframe for each raster cell in a raster layer? I reckon the two
locations might be even included within the raster cell. So it would me
most useful to me to select them as a function of each locations' distance
to each cell's centroid.

Here is a reference dataset, hope it is of help.

long=rnorm(50,10,3)
lat=rnorm(50,8,2)
TM=data.frame(long,lat)
coordinates(TM)=~long+lat
RL=raster(TM)
res(RL)=1


Many thanks in advance,

Agus
-- 

Agustín Camacho Guerrero.
Doutor em Zoologia.
Laboratório de Herpetologia, Departamento de Zoologia, Instituto de
Biociências, USP.
Rua do Matão, trav. 14, nº 321, Cidade Universitária,
São Paulo - SP, CEP: 05508-090, Brasil.

	[[alternative HTML version deleted]]

