2

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") 

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)

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?

Sorry to be rather unclear but I hardly know anything about GIS. Thank you!

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
user3482430
  • 21
  • 1
  • 2
  • 1
    You will benefit by reading the raster vignettes first. – Roman Luštrik Mar 31 '14 at 19:41
  • The units in resolution will depend on the coordinate system, and they look to me like decimal degrees (http://en.wikipedia.org/wiki/Decimal_degrees). Converting decimal degrees to a distance is a bit tricky because it will change by latitude, but what you have is about 1 by 1 km. About the second part of the question, are you sure you want to write all 2 million pixel values to a .csv? – andybega Mar 31 '14 at 19:44
  • See ?ratify to bring in the category values matched to pixel integers. Also ?area will give approximate size for lonlat data, but you should confirm that with projection ()<- . Note too that rgdal was required for raster to access the file. – mdsumner Mar 31 '14 at 20:22

1 Answers1

0

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)
UseR10085
  • 7,120
  • 3
  • 24
  • 54
Gago-Silva
  • 1,873
  • 4
  • 22
  • 46