[GRASS-user] importing bil file errors

Tyler Smith tyler at plantarum.ca
Mon Jan 20 13:08:34 PST 2014


Hello,

I am trying to import a .bil raster file into GRASS 7.0. The file is
available here:
http://webarchive.iiasa.ac.at/Research/LUC/External-World-soil-database/HTML/HWSD_Data.html?sb=4

Unzipping the data, I have three files:
hwsd.bil
hwsd.blw
hwsd.hdr

First I tried:
g.proj -c location=hwSoilsDB
georef=~/grassdata/downloads/harmonized_world_soil_database/hwsd.bil

which resulted in:
WARNING: Read of file
         /home/tws/grassdata/downloads/harmonized_world_soil_database/hwsd.bil
         was successful, but it did not contain projection information. 'XY
         (unprojected)' will be used

I get the same warning if I try with hwsd.blw. Trying with hwsd.hdr instead:

g.proj -c location=hwSoilsDB
georef=~/grassdata/downloads/harmonized_world_soil_database/hwsd.hdr
ERROR 1: The selected file is an ESRI BIL header file, but to
open ESRI BIL datasets, the data file should be selected
instead of the .hdr file.  Please try again selecting
the data file (often with the extension .bil) corresponding
to the header file:
/home/tws/grassdata/downloads/harmonized_world_soil_database/hwsd.hdr

ERROR: Could not read georeferenced file
       /home/tws/grassdata/downloads/harmonized_world_soil_database/hwsd.hdr
       using either OGR nor GDAL

This is confusing, because I already know GRASS won't load the .bil file.

GDAL doesn't list bil as a supported format, but since r.in.bin
doesn't support creating a new location I tried it anyways. It looks
promising:

r.in.gdal -c input=~/grassdata/downloads/harmonized_world_soil_database/hwsd.bil
location=hwSoilsDB output=hwSoil

This succeeds without complaint. So I switch into the new location and
import the raster, again with no complaints:

r.in.gdal input=~/grassdata/downloads/harmonized_world_soil_database/hwsd.bil
output=hwSoil

However, if I try to display the map I get an error:

d.rast map=hwSoil
ERROR: Cairo_begin_raster: Failed to create surface

Interestingly, if I now try to stop the display, I get another error:

d.mon stop=wx0
ERROR: PID file not found

I also tried r.in.bin, but the best I could do was:

r.in.bin input=~/grassdata/downloads/harmonized_world_soil_database/hwsd.bil
output=hwSoil bytes=1 rows=21600 cols=43200
ERROR: Invalid coordinates

And now I'm stuck. How do I get this bil file into GRASS?

Thanks,

Tyler


More information about the grass-user mailing list