[GRASS-user] Getting Gridded Population of the World (GPW) data into GRASS

Markus Neteler neteler at osgeo.org
Thu Oct 20 03:13:52 EDT 2011


On Thu, Oct 20, 2011 at 3:43 AM, Ben Madin
<lists at remoteinformation.com.au> wrote:
> G'day all,
>
> I have tried to search for this, but the only chain I found included some off-list component, and I'm not sure what actually happened.
>
> I have not been able to import GPW data into GRASS successfully.

I can confirm that, unfortunately.

> I am downloading data from http://sedac.ciesin.columbia.edu/gpw/global.jsp
>
> I have downloaded the .bil, the ascii grid and the ESRI GRID data types for population count and population density
...
> for example
>
>> r.in.gdal -o input=/Users/benmadin/Spatial/raster/gl_gpwfe_pcount_10_bil_25/glp10ag.bil output=glp10ag
> WARNING: Over-riding projection check
>  100%
> r.in.gdal complete. Raster map <glp10ag> created.

Now you first have to set the computational region to the map, otherwise
r.* will not compute reasonable results (unless you want to work on a
subregion).

But:

gdalinfo glp15ag
...
GEOGCS["WGS 84",
...
Upper Left  (-180.0000000,  85.0000000) (180d 0'0.00"W, 85d 0'0.00"N)
Lower Left  (-180.0000000, -58.0000000) (180d 0'0.00"W, 58d 0'0.00"S)
Upper Right ( 180.0000000,  85.0000000) (180d 0'0.00"E, 85d 0'0.00"N)
Lower Right ( 180.0000000, -58.0000000) (180d 0'0.00"E, 58d 0'0.00"S)
Center      (   0.0000000,  13.5000000) (  0d 0'0.00"E, 13d30'0.00"N)
Band 1 Block=8640x1 Type=Float32, ColorInterp=Gray

this looks ok to me. However, neighter GRASS 6 nor 7 can import it
correctly, some epsilon issue:

# note that -l doesn't change anything:
r.in.gdal glp15ag out=population_2015 -l
r.info population_2015
...
 |   Rows:         3432                                                       |
 |   Columns:      8640                                                       |
 |   Total Cells:  29652480                                                   |
 |        Projection: Latitude-Longitude                                      |
 |            N:        85N    S:        58S   Res: 0:02:30                   |
 |            E: 179:59:59.999999W    W:       180W   Res:     0              |
 |   Range of data:    min = 0  max = 1870454                                 |
...

g.region rast=population_2015 -p
projection: 3 (Latitude-Longitude)
zone:       0
datum:      wgs84
ellipsoid:  a=6378137 es=0.00669438
north:      85N
south:      58S
west:       180W
east:       179:59:59.999999W    <<--- !!!
nsres:      0:02:30
ewres:      0
rows:       3432
cols:       8640
cells:      29652480

d.rast.leg population_2015
ERROR: region for current mapset is invalid
       line 9: <e-w resol: 0>
       run "g.region"
ERROR: region for current mapset is invalid
       line 9: <e-w resol: 0>
       run "g.region"

We need to add something more in lib/gis/adj_cellhd.c in function
G_adjust_Cell_head().

Markus


More information about the grass-user mailing list