Skip to content

readAsciiGrid (maptools) 2

3 messages · Ingo Holz, Roger Bivand, Michal Gallay

#
Hi again,

 OK, it is not a problem of readAsciiGrid (maptools)!

 However:

 x <- 3539000.5 : 3540000.5   ## OK, readAsciiGrid adds .5 to the coordinates
 length(x)
 x[1:10]
 min(x)                       ## OK, this is the rounded value
 summary(x)                   ## I still do not understand this
 summary(1:1001)

 I get the following results:
[1] 1001
[1] 3539001 3539002 3539003 3539004 3539005 3539006 3539007 3539008 3539009 
3539010
[1] 3539001
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
3539000 3539000 3540000 3540000 3540000 3540000
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      1     251     501     501     751    1001
Ingo
#
On Tue, 13 Nov 2007, Ingo Holz wrote:

            
length(x)
[1] 1001
Min.   1st Qu.    Median      Mean   3rd Qu.      Max.
3539000.5 3539250.5 3539500.5 3539500.5 3539750.5 3540000.5

OK?

Roger

  
    
#
I Ingo,

I had a similar problem when reading ESRI ASCII grid in R. After checking 
it in ArcGIS I found out that there is one row of NoData values at the 
edges, when exporting from Arc. It has to do with the definition of the 
extent of the analysis and the grid cell definition (lower left corner or 
center of the cell).

This, doesn't really explain why you see the lenght of 1000 and 1001, but 
perhaps gives a clue.

Michal
On Nov 13 2007, Ingo Holz wrote: