[R-sig-Geo] To extract coordinates and NDVI value for each pixel

Komine momadou at yahoo.fr
Thu Sep 15 20:05:11 CEST 2011


Hi,
Thank you Mathieu for your answer. I tried with write.matrix (MASS) but the
result don't change. I have not all the matrix. I want that all the matrix
appears on the 
console or to save it in a file (.txt). If I try a small Matrix for example
(Mat1[1:5,]) the result is correct but If I use the true size of my matrix
(Mat[1:5168101,] I have not all the matrix 
How can I save the entire matrix to a file (. txt)? 

I used this code:
>library(raster)
>adresse<-"C:\\Users\\Documents\\DISC D\\\Images282"
>a <- raster(adresse)  
>CentreRaster <- rasterToPoints(a)
>PixelColonne <- as.data.frame(CentreRaster)
>PixelColonne <- cbind(PixelColonne,coordonnee =
paste(PixelColonne[,1],PixelColonne[,2],sep=" "))
>colnames(PixelColonne) <-
c("Longitude","Latitude","ValeurPixel","Coordonnees")
>return(PixelColonne)
>}
>Mat1 <- RasterToColonne(adresse) 
>Mat1[1:5168101,] 
>library(MASS)
>write.matrix(Mat1, file = "", sep = " ")

Thank you in advance 
Komine 


--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/To-extract-coordinates-and-NDVI-value-for-each-pixel-tp6737676p6797943.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list