[R-sig-Geo] redundancy of coordinates of pixels

Roger Bivand Roger.Bivand at nhh.no
Mon Feb 13 20:32:36 CET 2012


On Mon, 13 Feb 2012, Komine wrote:

> Hi,
> I actualize my topic because I have not again a solution.
> I have in a matrix 1 255 153 rows and corresponding to the coordinates of
> burned pixels on 10 years. The coordinates are in UTM. I want to know the
> pixels burned several times on the 10 years. However, less 1% of my pixels
> were burned on the 10 years. It seems false. My code uses the center of
> pixels, in this case, a same area can burn several times in the 10 years,
> but because the center of pixels differ little one year to another, the code
> will not show correctly me the pixels which burn each year. Because the code
> required that the pixels have EXACTELY the same cordinates.
> Do you known a solution with R to resolve this problem? I'm not looking that
> pixels overlap exactly but a slight delay is not bad.
> My Code:
>> redon<-read.table("C:\\Users\\Documents\\\\PixelFire.txt",sep="",dec=",",header=TRUE)
>> XY <- redon[c("X", "Y")]
>> Z<-xtabs(~apply(XY,1,paste,collapse="-"))
>> Z2<-matrix(unlist(strsplit(names(Z),"-")),ncol=2,byrow=T)
>> Matrice<-data.frame(Z2,freq=Z[])
>> write.table(Matrice,"C:\\Users\\Desktop\\Matrice.txt",sep=" ")

Two possibilities, one using nn2() in the RANN package with 
searchtype="priority" and eps < 0.0, the other to define a grid over your 
study area and count points falling in each grid cell.

Hope this helps,

Roger

>
> Sorry for my bad English!
> Thank you in advance
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/redundancy-of-coordinates-of-pixels-tp7169408p7281513.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
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