r.in.gdal in GRASS5

Frank Warmerdam warmerda at home.com
Tue Sep 26 18:38:36 EDT 2000


Folks, 

I have mentioned this work before, but I am pleased to announce that 
r.in.gdal has been checked in the GRASS 5 CVS tree.  It is a generalized
import program for ingesting any file formats supported by GDAL (the
Geospatial Data Abstraction Library).  

A full list of file formats supported by GDAL are available at:
  http://www.remotesensing.org/gdal/formats_list.html

Of particular note to GRASS users, GDAL has good support for GeoTIFF.  It
reads most configurations of TIFF file (stripped, tiled, 8bit, 16bit, floating
point, RGB, YCbCr,...) and includes support for reading the GeoTIFF 
extents, and projection definition information.  The GeoTIFF projections
support should also be amoung the most comprehensive available anywhere.

It also includes Erdas Imagine (.img) format, somewhat generic CEOS support, 
ESRI labelled BIL, and Arc/Info binary grid.  

The r.in.gdal command also takes a slightly new tack to projections.  It
reads the projection of the source dataset, and reports a fatal error if it
does not match the current location (this check can be disabled with the -o
flag).  However, instead of the user having to manually define a new location
and carefully setup the projection parameters, and bounds, it is possible to
just rerun r.in.gdal, with the "location" parameter set to the name of the
new location you would like to create.  r.in.gdal will create the location
and default the projection and extents based on the dataset. 

The r.in.gdal command also takes an odd approach to supporting multi-band
datasets.  If the input file (such as an RGB TIFF file) has more than one
band, and if the user doesn't select a particular band to import, the 
r.in.gdal command will create an imagery group, as well as a raster layer
for each band.  If the source file has only one band, then no imagery
group is created for it. 

The full documentation for the command is available at:

  http://gdal.velocet.ca/projects/grass/r.in.gdal.html

Note that r.in.gdal depends on having the libgdal.1.1.so shared library 
installed somewhere accessable, adding a bit of complexity.  The web page
at:

  http://gdal.velocet.ca/projects/grass 

includes a pointer to a pre-built version of libgdal.1.1.so for Linux.  The 
GDAL web page at http://www.remotesensing.org/gdal can be consulted for the 
full GDAL source to build-it-yourself.  I am hoping that in the future, 
pre-built GRASS binary distributions, such as the FreeGIS package will 
include libgdal.1.1.so. 

For those wanting to use r.in.gdal in the near term, the source for r.in.gdal
can be fetched from the projects page (http://gdal.velocet.ca/projects/grass), 
or you can get it from the GRASS 5 CVS tree.   For now, it will likely be
necessary for the distributed Gmakefile to have the $(DLLIB) macro hand
replaced with -ldl.  Any bug reports can be sent directly to me, as well
as suggestions for improvements, or requests for assistance in using it.

In future weeks, I also hope to discuss progress in the use of OSSIM, and
OpenEV as viewers for GRASS raster data, due to the integration of GRASS
raster support in GDAL for other client programs. 

Finally, I would like to thank Markus and Bernhard for all their support, 
and ImageLinks who funded the OSSIM/GRASS Bridge contract which helped get
me far enough into GRASS to implement this (though it isn't actually a 
deliverable for that contract).  

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerda at home.com
light and sound - activate the windows | http://members.home.com/warmerda
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the grass-user mailing list