Hello,

I have an Ascii grid that was created using the GridAscii command in 
ArcGrid.  The grid represents cell distance to railroads and has values 
ranging from 0 to 37,082.  When I bring this grid into R as a 
SpatialGridDataFrame, the maximum and/or the minimum values in the grid do 
not exactly match the original grid.  I have tried using both readGDAL and 
readAsciiGrid for this purpose.  I have confirmed in a text editor that 
the Ascii file does contain the maximum value of 37,082.  Below are the 
results I have seen.  Note the differences in the Max. value and Min. 
value (from readGDAL).

> g1 <- readAsciiGrid("G:/Oconto/WI_Fire/distrail_100m.asc")
> summary(g1)
Object of class SpatialGridDataFrame
Coordinates:
                min      max
coords.x1 -263487.6 149512.4
coords.x2  358821.1 666821.1
Is projected: NA 
proj4string : [NA]
Number of points: 2
Grid attributes:
  cellcentre.offset cellsize cells.dim
1         -263437.6      100      4130
2          358871.1      100      3080
Data attributes:
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      0    2878    6562    7896   11670   37080 6483714 

> g2 <- readGDAL("G:/Oconto/WI_Fire/distrail_100m.asc")
G:/Oconto/WI_Fire/distrail_100m.asc has GDAL driver AAIGrid 
and has 3080 rows and 4130 columns
> summary(g2)
Object of class SpatialGridDataFrame
Coordinates:
        min      max
x -263487.6 149512.4
y  358821.1 666821.1
Is projected: NA 
proj4string : [NA]
Number of points: 2
Grid attributes:
  cellcentre.offset cellsize cells.dim
x         -263437.6      100      4130
y          358871.1      100      3080
Data attributes:
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
 -32770    2844    6516    7718   11600   32770 6483714 

The results from readAsciiGrid are pretty close (Max = 37,080) to the 
original grid, but readGDAL results in much different values.  I would 
expect both functions to create an object with exactly the same values as 
the Ascii grid.  Can anyone explain why this occurs, and if there is a 
different way to get my grid into R (I eventually need an 'im' to work 
with)?  I am new to spatial analysis using R, so if there is something 
obvious I am missing I apologize.  Thanks in advance for any help!

Cheers,
-Brian


=======================
Brian R. Miranda
USDA Forest Service
Northern Research Station
brmiranda@fs.fed.us

Institute for Applied Ecosystem Studies
5985 Highway K
Rhinelander, WI  54501
phone: 715-362-1186
fax: 715-362-1166


	[[alternative HTML version deleted]]


