An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110218/a8cf4e8a/attachment.pl>
Selecting a raster cell which contains a point of given coordinates
3 messages · luca candeloro, Tom Gottfried, Robert J. Hijmans
Suppose you want to know the attribute values of the grid cell: ?over ?overlay regards, Tom Am 18.02.2011 08:56, schrieb luca candeloro:
Hi all,
I have a raster file read by:
Map=readGDAL(paste("C:/Temperature/HDF/TERRA/TIF/Terra.",datesMOD11A1[d],".LST_Day_1km.tif",sep=""))
and a point coordinates like:
Gattia=matrix(c(x=13.66966,y=42.63941), ncol=2)
Gattia=project(Gattia,proj4string(Map))
I would like to know which is the cell in the Map that contains the
coordinates of the point named Gattia.
Any help?
Thanks,
Luca.
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Technische Universit?t M?nchen Department f?r Pflanzenwissenschaften Lehrstuhl f?r Gr?nlandlehre Alte Akademie 12 85350 Freising / Germany Phone: ++49 (0)8161 715324 Fax: ++49 (0)8161 713243 email: tom.gottfried at wzw.tum.de http://www.wzw.tum.de/gruenland
Hi all,
I have a raster file read by:
Map=readGDAL(paste("C:/Temperature/HDF/TERRA/TIF/Terra.",datesMOD11A1[d],".LST_Day_1km.tif",sep=""))
and a point coordinates like:
Gattia=matrix(c(x=13.66966,y=42.63941), ncol=2)
Gattia=project(Gattia,proj4string(Map))
I would like to know which is the cell in the Map that contains the
coordinates of the point named Gattia.
Luca, you can do: library(raster) r <- raster(Map) cellFromXY(r, Gattia) Robert
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Selecting-a-raster-cell-which-contains-a-point-of-given-coordinates-tp6039068p6040813.html Sent from the R-sig-geo mailing list archive at Nabble.com.