[Gdal-dev] Import WorldClim data byte issue

Frank Warmerdam warmerdam at pobox.com
Wed Oct 25 21:13:34 EDT 2006

Markus Neteler wrote:
> hi,
> we tried to import the worldclim tile data (generic format BIL)
> from
> http://www.worldclim.org/tiles.php
> Unfortunately the result ranges from 0-65535.
> The page http://www.worldclim.org/format.htm describes
> "The data files (.BIL) are sequential binary files in which
>  values are stored line by line from the upper-left to the
>  lower-right corner. Each cell (pixel) is an integer value
>  (2 bytes; -32768..32767).
> "
> Do I need postprocessing (such as r.mapcalc in GRASS) to
> read these maps or is there another nice trick?


The EHDR (ESRI .HDR labelled BIL) driver now supports a keyword in
the file called PIXELTYPE which can have values like SIGNEDINT,
UNSIGNEDINT or FLOATINGPOINT.  So just add a line like the following in
the .hdr file.


Future versions of ArcGIS, and possibly 9.2 should also honour this
keyword.  The capability was included in GDAL 1.3.2.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list