[GRASS-user] exporting Grass rasters to multiband Geotiff?

Frank Warmerdam warmerdam at pobox.com
Thu Nov 2 10:41:24 EST 2006


Vishal Mehta wrote:
> I actually did look at previous emails but could not get a definite 
> answer, and also did'nt follow the VRT discussion in earier emails.
> 
> Meanwhile actually, I'm having trouble with using r.out.gdal on even a 
> single image .
> My original grass raster has integer values from -262 to 276, and the 
> r.info <http://r.info> output says that its CELL format . So i assumed 
> that the type is Int16, and used the following command:
> 
> r.out.gdal input=avgtemp1960.1 format=GTiff type=Int16 
> output=jan1960.tiff createopt="TFW=YES"
> 
> I then imported the output Geotiff into both IDRISI as well as 
> GRASS(using r.in.gdal)
> 
> In both cases, the values are completely different and go from 0 to 32767.

Vishal,

This sounds like there may be a bug in r.out.gdal.  Int16 should be
an appropriate selection.

> Int32 and Float32 options dont work either. Any ideas?
>
> In my opinion, I find that in general, the documentation for this in 
> Grass as well as Gdal is inadequate. There should be one example for 
> each type of format..

You are suggesting that the GDAL documentation ought to have one example
of using the format for each format driver page?  Should the example
use GDAL commandline tools?  GRASS?  ArcGIS?  As a library it is very
hard to provide a meaningful example to end users when the library is
used in many different applications.

I hope you will recognise that in a decoupled system such as GRASS and
GDAL it is difficult to document everything in a most convenient way
for the user.

> And what is the difference between 'Tiles' and 'Bands'?

I think you should scan the data model document on the gdal page,
and then if it is still unclear ask again.

> Finally, where can i figure out what Int16/32, Float32, Cint16, Cint32  
> - what these things mean?

You can read the GDAL web pages - look for "data model".

But mostly they mean what you would expect.  Int16 is a signed 16bit
integer. Float32 is a 32bit IEEE floating point.  CInt16 is a bit trickier.
It is a signed 16bit integer complex value (ie. two Int16's one representing
the real component, and one the imaginary component).

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 grass-user mailing list