[kepler-dev] GIS/GDAL question

Dave Vieglais vieglais at ku.edu
Wed Nov 30 21:17:12 PST 2005


Hi Dan,

from gdal-1.3.1/frmts/raw/ehdrdataset.cpp :

        else if( EQUAL(papszTokens[0],"NBITS") )
        {
            if( atoi(papszTokens[1]) == 16 )
                eDataType = GDT_Int16;
            else if( atoi(papszTokens[1]) == 32 )
                eDataType = GDT_Float32;
            else if( atoi(papszTokens[1]) == 64 )
                eDataType = GDT_Float64;
        }

http://www.esri.com/library/whitepapers/pdfs/eximgav.pdf implies INT, and also
indicates a variety of sizes that are not covered by GDAL (notably 1 and 4
bits not in gdal, 64 bit formats are not specified in the esri doc):

"nbits—The number of bits per pixel per band. Acceptable values are 1, 4, 8,
16, and 32. The default value is eight bits per pixel per band. For a true
color image with three bands (R, G, B) stored using eight bits for each pixel
in each band, nbits equals eight and nbands equals three, for a total of
twenty-four bits per pixel. For an image with nbits equal to one, nbands must
also equal one. "

Other docs around the place indicate BIL in floating point format, or integer.
 Basically there is no mechanism in BIL to specify the type of data, just the
size.  Apart from tweaking GDAL, there doesn't seem to be any simple fix for
this - you could try something like reading the data into an im memory raster,
casting to INT32 as you read the pixels, then do the transform on the in
memory raster.  But that doesn't seem like something to do in Kepler.

I would suggest converting the files with another product to GeoTiff, which is
a much more robust format.

Dave V.

Dan Higgins wrote:
> Kevin,
>     The docs I have found for gdal_translate have an output format but I
> cannot find an input format. Do you have a reference or example for how
> to specify the input?
> 
> Dan
> 
> Kevin Ruland wrote:
> 
>>Dan,
>>
>>I'll look into this in the morning.
>>
>>gdal_translate lets you specify input and output formats including
>>representation.
>>
>>Kevin
>>
>>Dan Higgins wrote:
>>
>>  
>>
>>>Hi All,
>>>
>>>   Any GIS/GDAL experts out there?
>>>
>>>   As part of the ENM/GARP workflows, we need to read and re-project 
>>>some *.bil raster files. We are using some GDAL code in actors to do 
>>>this. The problem is that one of the *.bil input files is specified with 
>>>NBITS=32 in the *.hdr file. GDAL apparently assumes that NBITS=32 
>>>corresponds to 32-bit floating point data, but some other applications 
>>>assume it is 32 bit INT data!
>>>
>>>   The data is apparently 32 bit INTs. Is *.bil data always INT data? 
>>>(It allows 8 and 16 bit data which are integers; I see no way of 
>>>specifying what 32 bit data represents.) Is there any way in GDAL (eg 
>>>GDALWARP) to set the assumed input datatype? (i.e. tell GDAL to assume 
>>>INT rather than FLOAT?)
>>>
>>>Dan
>>>
>>> 
>>>
>>>    
>>>
>>
>>
>>  
>>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev


More information about the Kepler-dev mailing list