NAME

r.in.gdal - Import GDAL supported raster file into a binary raster map layer.
(GRASS Raster Data Import Program)

SYNOPSIS

r.in.gdal
r.in.gdal help
r.in.gdal [-o] input=name [band=number] output=name [TITLE="phrase"] [location=name]

DESCRIPTION

r.in.gdal allows a user to create a (binary) GRASS raster map layer, or imagery group, from any GDAL supported raster file format, with an optional title. The imported file may also be optionally used to create a new location.

OPTIONS

Flags:

-o
Override projection (use locations projection)

Parameters:

input=name
Name of an existing GDAL supported raster file to be imported.
band=number
Number of input band to extract (default is all bands). Number between 1 and number of bands.
output=name
Name to be assigned to resultant binary raster map layer or imagery group. An imagery group is generated if more than one band is imported.
TITLE="phrase"
Title to be assigned to resultant raster map layer(s).
location=name
Name of new location to create based on the file, if so desired.

GDAL Supported Formats

Full details on GDAL supported formats are available at:

http://www.remotesensing.org/gdal/formats_list.html

Format Name					Georeferencing

Arc/Info Binary Grid Yes
CEOS (Spot for instance) No First Generation USGS DOQ Yes New Labelled USGS DOQ Yes Military Elevation Data (DTED) Yes Eosat Fast Format No ESRI .hdr Labelled Yes TIFF / GeoTIFF Yes Erdas Imagine .hfa No JPEG JFIF No PCI .aux Labelled Yes Portable Network Graphics (PNG) No USGS SDTS DEM Yes SAR CEOS No
If GDAL doesn't support the indicated file it will report it with a message like ERROR 4: `abc.e00' not recognised as a supported file format . This means either that the file doesn't exist, that it isn't supported by GDAL, or that the format wasn't built into the version of libgdal.1.1.so being used.

r.in.gdal will only operate correctly if the GDAL shared library is installed on the system and accessable (normally via LD_LIBRARY_PATH). If not, r.in.gdal will report Unable to initialize GDAL bridge. If this occurs it means that you either don't have GDAL installed (ie. libgdal.1.1.so), it isn't in the LD_LIBRARY_PATH, or it is the wrong version.

Location Creation

r.in.gdal attempts to preserve projection information when importing datasets if the source format includes projection information, and if the GDAL driver supports it. If the projection of the source dataset does not match the projection of the current location r.in.gdal will report an error message (Projection of dataset does not appear to match current location) and then report the PROJ_INFO parameters of the source dataset.

If the user wishes to ignore the difference between the apparent coordinate system of the source data and the current location, they may pass the -o flag to override the projection check.

If the user wishes to import the data with the full projection definition, it is possible to have r.in.gdal automatically create a new location based on the projection and extents of the file being read. This is accomplished by passing the name to be used for the new location via the location parameter. Upon completion of the command, a new location will have been created (with only a PERMANENT mapset), and the raster will have been imported with the indicated output name into the PERMANENT mapset.

NOTES

I plan to make a variety of improvements to r.in.gdal in the future including support for reporting everything known about a dataset if the output parameter is not set and support for GCPs.

The r.in.gdal comand does support the following features, as long as the underlying format driver supports it:

Color Table
Bands with associated colortables will have the color tables transferred.
Data Types
Most GDAL data types are supported. Float32 and Float64 type bands are translated as GRASS floating point cells (but not double precision ... this could be added if needed), and all other types are translated as GRASS integer cells. This includes 16bit integer data sources. Complex (some SAR signal data formats) data is currently truncated to integer values from the real component.
Georeferencing
If the dataset has affine georeferencing information, this will be used to set the north, south, east and west edges. Rotational coefficients will be ignored, resulting in incorrect positioning for rotated datasets.
Projection
The datasets projection will be used to compare to the current location or to define a new location. Internally GDAL represents projections in OpenGIS Well Known Text format. A large subset of the total set of GRASS projections are supported.

AUTHOR

Frank Warmerdam (warmerda@home.com).