[Gdal-dev] Import WorldClim data byte issue

Dieter Lehmann dieter.lehmann at hfwu.de
Thu Oct 26 02:40:55 EDT 2006

Hi Markus,
some time ago I get stucked with the same issue. I wrote to Robert and  
got this
answer...where a reclass is recomended.


Well, this points at a familiar problem.
16-bit (2 byte) integer data can store  65536 numbers
Normally, an integer value of this type can therefore be between
But it can also represent a "word", i.e. a value between 0 - 65535

if a program confuses one type with the other, like I think happened in
this case, -1 becomes 66535, -2 becomes 66534, etc. 66615 should really be

So a reclass like

if (oldvalue > 23768)
    then newvalue = 66535 - value
    else newvalue - oldvalue

should correct this.


Quoting Markus Neteler <neteler at itc.it>:

> 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?
> thanks
> markus
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev

Dipl. Ing. (FH) Dieter Lehmann (MAS)
Rechenzentrum HfWU
Tel. 07022-404-235
dieter.lehmann at hfwu.de

This message was sent using IMP, the Internet Messaging Program.

More information about the Gdal-dev mailing list