[GRASS-user] importing bil file errors

Markus Neteler neteler at osgeo.org
Mon Jan 20 14:42:16 PST 2014


Tyler,

the data set lacks the projection metadata, hence GRASS cannot guess that:

[neteler at oboe hwsd_soil]$ gdalinfo hwsd.bil
Driver: EHdr/ESRI .hdr Labelled
Files: hwsd.bil
       hwsd.blw
       hwsd.hdr
Size is 43200, 21600
Coordinate System is `'
Origin = (-180.000000000000000,89.999999999928036)
Pixel Size = (0.008333333333330,-0.008333333333330)
Corner Coordinates:
Upper Left  (-180.0000000,  90.0000000)
Lower Left  (-180.0000000, -90.0000000)
Upper Right ( 180.0000000,  90.0000000)
Lower Right ( 180.0000000, -90.0000000)
Center      (  -0.0000000,  -0.0000000)
Band 1 Block=43200x1 Type=UInt16, ColorInterp=Undefined

[neteler at oboe hwsd_soil]$ cat hwsd.blw
                   0.00833333333333
                   0.00000000000000
                   0.00000000000000
                  -0.00833333333333
                -179.99583333333334
                  89.99583333326137

[neteler at oboe hwsd_soil]$ cat hwsd.hdr
BYTEORDER      I
LAYOUT       BIL
NROWS         21600
NCOLS         43200
NBANDS        1
NBITS         16
BANDROWBYTES         86400
TOTALROWBYTES        86400
BANDGAPBYTES         0

So, GRASS 7 import:

grass70 -c EPSG:4326 ~/grassdata/hwsd
# -e: expand location to dataset; -o: override (missing) projection in
input dataset:
r.in.gdal input=hwsd.bil output=hwsd -e -o
g.region rast=hwsd -p
# or use wxGUI...:
d.mon wx0
d.rast hwsd
# ops, too big for our CAIRO driver :p
ERROR: Cairo_begin_raster(): Failed to create surface (invalid value
       (typically too big) for the size of the input (surface, pattern,
       etc.))

g.gui the same at full world extent.

But display works for a subset at least.

The analytical tools do obviously not show this problem.

For convenience added to the Wiki, too:
http://grasswiki.osgeo.org/wiki/Global_datasets#Harmonized_World_Soil_Database_.28HWSD_Database.29

Hope this helps,
Markus


More information about the grass-user mailing list