Skip to content
Back to formatted view

Raw Message

Message-ID: <1316109911788-6797943.post@n2.nabble.com>
Date: 2011-09-15T18:05:11Z
From: Komine
Subject: To extract coordinates and NDVI value for each pixel
In-Reply-To: <CAGfc75kV2w-=q4EKyK7onfBYP6E0TrtgtANcXKq_T6qCj-Vw8g@mail.gmail.com>

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.