[R-sig-Geo] RV: [Rsig-Geo] Raster processing, pop density estimation and more

Luciano La Sala lucianolasala at yahoo.com.ar
Mon Jan 7 13:36:30 CET 2013


Dear r-sig-geo crew, 
Sorry about the redundant posting of a naïve issue here, but I can't seem to
wrap my head around it. 
I have a raster image of human population counts a LandScan grid at a
resolution of 1 km where each pixel's value represents population number,
which I am processing using Quantum GIS and GRASS the modules inside of it.

Using GRASS (either module r.out.ascii or r.out.xyz) I  got an ASCII text
file which I then loaded into R using the rgdal package as shown below.

However, I get a dataframe consisting of three columns and as many rows as
max print permits (see output below). 

Q1. What do these values represent? 
Q2. How can I view the population data corresponding to each cell? I need
this variable to do some statistics.        
Q3. What does the "GDAL driver XYZ and has 4289 rows and 2375 columns" piece
really mean? Does it mean that I have 4289*2375 = 10186375 cells?

Thanks in advance, 

Luciano 

###################################

> r <- readGDAL("C:/Users/.../ASCII_XYZ/XYZ")


C:/Users/Luciano/Documents/Analisis/Risk_AI/ASCII_XYZ/XYZ has GDAL driver
XYZ and has 4289 rows and 2375 columns

> r

Object of class SpatialGridDataFrame
Object of class SpatialGrid

Grid topology:
  cellcentre.offset cellsize cells.dim
x         -597582.9 873.0906      2375
y         3847318.5 873.0906      4289

SpatialPoints:

[4007,]  826427.8274 7590258
[4008,]  827300.9180 7590258
[4009,]  828174.0086 7590258
[4010,]  829047.0992 7590258
....
....
....
[4999,] -381056.4737 7589385
[5000,] -380183.3831 7589385

[ reached getOption("max.print") -- omitted 10181375 rows ] Coordinate
Reference System (CRS) arguments: NA 

Data summary:
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
    0.00     0.00     0.00     3.56     0.00 54760.00



More information about the R-sig-Geo mailing list