Re: reading 32 bit/sample tiffs

Frank Warmerdam <[email protected]>
Newsgroups gmane.comp.gis.freegis
Message-ID <[email protected]>
On 8/18/05, [email protected] <[email protected]> wrote:
> I recently downloaded a NED 1/3 elevation Geotiff file from the USGS
> SDDS (Seamless...).  The Geotiff has 32 bit/sample according to
> tiffinfo, but I can't find anything simple (on Linux) which will read
> this file or convert it to an 8 bit/sample file.  Any ideas?  Any
> reason why USGS would distribute such a format?  Thanks.

Dallas, 

I'm not sure of the details of the dataset.  Perhaps it is 32bit floating
point to preserve better than 1m vertical resolution. 

You can use "gdal_translate" to rescale this to 8bit using a command
like:

gdal_translate -scale -ot Byte 32bit_ned.tif 8bit_ned.tif

You can find prebuilt binaries for linux and win32 at:

  http://fwtools.maptools.org/

Details about GDAL are available at:

  http://www.gdal.org/

I'm not sure what you want to rescale the elevation data to 8bit for.
It won't be directly useful as elevation values any more.  Depending
on your needs you may find it helpful to convert to 16bit without
changing elevation values (well possibly truncating them):

  gdal_translate -ot Int16 32bit_ned.tif 16bit_ned.tif

Or controlling the scaling to 8bit:

  gdal_translate -scale 0 3000 0 255 -ot Byte in.tif out.tif

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [email protected]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.