[R-sig-Geo] Open raster _ extract pixel value

Komine momadou at yahoo.fr
Sun Mar 13 23:27:08 CET 2011


Dear all,
I tried your suggestion doing this:

library(raster)
myobject <-
raster("C:\\Users\\komine\\Desktop\\MODIS\\MYD09GQ.A2010280.h16v07.005.2010282160347.sur_refl_b01_1.tif")
e <- extent(-90, -32, -60, 15)
r <-
crop("C:\\Users\\komine\\Desktop\\MODIS\\MYD09GQ.A2010280.h16v07.005.2010282160347.sur_refl_b01_1.tif",e)
plot(myobject)

the result is here:
> library(raster)
> myobject <-
> raster("C:\\Users\\komine\\Desktop\\MODIS\\MYD09GQ.A2010280.h16v07.005.2010282160347.sur_refl_b01_1.tif")
Fixing "AREA_OR_POINT=Point" georeference
> e <- extent(-90, -32, -60, 15)
> r <-
> crop("C:\\Users\\komine\\Desktop\\MODIS\\MYD09GQ.A2010280.h16v07.005.2010282160347.sur_refl_b01_1.tif",e)
Erreur dans function (classes, fdef, mtable)  :
  unable to find an inherited method for function "crop", for signature
"character"
> plot(myobject)

However the raster appear in spite of the previous error message.
1- I suppose that I did an error although R read my raster?
2- Could you explain me the meaning of: extent(-90, -32, -60, 15)

Thanks for your help


--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Open-raster-extract-pixel-value-tp6166730p6167299.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list