R中的RasterLayer [英] RasterLayer in R
问题描述
我有一个包含几个.adf文件的GIS项目.当我刚接触ArcMap时,我不知道如何使用它们.我设法使用光栅库将它们读入r
I have a GIS project containing several .adf files. As I m new to ArcMap I don t know how to use them. I managed to read them into r using the raster library
r <- raster("w001001.adf")
查看sum(r)时,我得到:
When looking at sum(r) I get:
sum(r)
class : RasterLayer
dimensions : 1641, 1358, 2228478 (nrow, ncol, ncell)
resolution : 0.008333333, 0.008333333 (x, y)
extent : -47.63578, -36.31911, -20.93489, -7.259889 (xmin, xmax, ymin, ymax)
coord. ref. : NA
data source : C:\Users\balal\Desktop\blabla\w001001.adf
names : w001001
values : 1, 15 (min, max)
我试图查找有关单元格大小和每个单元格的土地使用情况的信息(我假设土地使用情况与值有关,因为我有15种土地使用情况类别.)并将此数据放入表格中,可以写为.csv.R可以吗?还是我看错了文件?
I trying to find information regarding the size of the cells and the land use of each cell (I assume the land use is related to the values as I have 15 land use categories.) and bring this data into a table which I can write as .csv. Is this possible with R? Or am I looking at the wrong file?
很抱歉,我不清楚,但是我几乎不了解GIS.谢谢!
Sorry to be rather unclear but I hardly know anything about GIS. Thank you!
推荐答案
您始终可以以矩阵格式获取栅格文件中的信息(像元值):
You can always get the information inside the raster file (cell values) in matrix format:
r.matrix<-as.matrix(r)
每个单元格的大小由下式给出:
The size of each cell is given by:
resolution : 0.008333333, 0.008333333 (x, y)
这篇关于R中的RasterLayer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!