.TH r.out.gdal 1grass "" "GRASS 6.4.2" "Grass User's Manual" .SH NAME \fI\fBr.out.gdal\fR\fR - Exports GRASS raster maps into GDAL supported formats. .SH KEYWORDS raster, export .SH SYNOPSIS \fBr.out.gdal\fR .br \fBr.out.gdal help\fR .br \fBr.out.gdal\fR [-\fBlcf\fR] [\fBinput\fR=\fIname\fR] [\fBformat\fR=\fIstring\fR] [\fBtype\fR=\fIstring\fR] [\fBoutput\fR=\fIname\fR] [\fBcreateopt\fR=\fIstring\fR[,\fIstring\fR,...]] [\fBmetaopt\fR=\fIstring\fR[,\fIstring\fR,...]] [\fBnodata\fR=\fIfloat\fR] [--\fBverbose\fR] [--\fBquiet\fR] .SS Flags: .IP "\fB-l\fR" 4m .br List supported output formats .IP "\fB-c\fR" 4m .br Do not write GDAL standard colortable .br Only applicable to Byte or UInt16 data types. .IP "\fB-f\fR" 4m .br Force raster export despite any warnings of data loss .br Overrides nodata safety check. .IP "\fB--verbose\fR" 4m .br Verbose module output .IP "\fB--quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBinput\fR=\fIname\fR" 4m .br Name of raster map (or group) to export .IP "\fBformat\fR=\fIstring\fR" 4m .br GIS format to write (case sensitive, see also -l flag) .br Options: \fIVRT,GTiff,NITF,HFA,ELAS,AAIGrid,DTED,PNG,JPEG,MEM,GIF,XPM,BMP,PCIDSK,PCRaster,ILWIS,SGI,SRTMHGT,Leveller,Terragen,GMT,netCDF,HDF4Image,ISIS2,ERS,JPEG2000,FIT,RMF,WMS,RST,INGR,GSAG,GSBG,R,PNM,ENVI,EHdr,PAux,MFF,MFF2,BT,LAN,IDA,GTX,NTv2,USGSDEM,ADRG,BLX,Rasterlite,EPSILON,SAGA,KMLSUPEROVERLAY,XYZ,HF2,ZMap\fR .br Default: \fIGTiff\fR .IP "\fBtype\fR=\fIstring\fR" 4m .br File type .br Options: \fIByte,Int16,UInt16,Int32,UInt32,Float32,Float64,CInt16,CInt32,CFloat32,CFloat64\fR .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output raster file .IP "\fBcreateopt\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br Creation option(s) to pass to the output format driver .br In the form of "NAME=VALUE", separate multiple entries with a comma. .IP "\fBmetaopt\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br Metadata key(s) and value(s) to include .br In the form of "META-TAG=VALUE", separate multiple entries with a comma. Not supported by all output format drivers. .IP "\fBnodata\fR=\fIfloat\fR" 4m .br Assign a specified nodata value to output bands .PP .SH DESCRIPTION \fIr.out.gdal\fR allows a user to export a GRASS raster map layer into any GDAL supported raster map format. If a GRASS raster map is exported for a particular application, the application's native format would be preferrable. GeoTIFF is supported by a wide range of applications (see also \fBNOTES\fR on GeoTIFF below). .PP To specify multiple creation options use a comma separated list (\fIcreateopt="TFW=YES,COMPRESS=DEFLATE"\fR). .PP For possible \fIcreateopt\fR and \fImetaopt\fR parameters please consult the individual supported formats pages on the GDAL website. The \fIcreateopt\fR parameter may be used to create TFW or World files ("TFW=YES","WORLDFILE=ON"). .PP \fIr.out.gdal\fR also supports the export of multiband rasters as a group, when the imagery group's name is entered as input. (created imagery groups with the \fIi.group\fR module) .PP As with most GRASS raster modules, the current region extents and region resolution are used, and a MASK is respected if present. Use \fIg.region\fR's "align=", or "rast=" options if you need to realign the region settings to match the original map's before export. .SH SUPPORTED RASTER FORMATS The set of supported raster formats written by \fIr.out.gdal\fR depends on the local GDAL installation. Available may be (incomplete list): .PP \fC .DS .br AAIGrid: Arc/Info ASCII Grid .br BMP: MS Windows Device Independent Bitmap .br BSB: Maptech BSB Nautical Charts .br DTED: DTED Elevation Raster .br ELAS: ELAS .br ENVI: ENVI .hdr Labelled .br FIT: FIT Image .br GIF: Graphics Interchange Format (.gif) .br GTiff: GeoTIFF .br HDF4Image: HDF4 Dataset .br HFA: Erdas Imagine Images (.img) .br JPEG2000: JPEG-2000 part 1 (ISO/IEC 15444-1) .br JPEG: JPEG JFIF .br MEM: In Memory Raster .br MFF2: Atlantis MFF2 (HKV) Raster .br MFF: Atlantis MFF Raster .br NITF: National Imagery Transmission Format .br PAux: PCI .aux Labelled .br PCIDSK: PCIDSK Database File .br PNG: Portable Network Graphics .br PNM: Portable Pixmap Format (netpbm) .br VRT: Virtual Raster .br XPM: X11 PixMap Format .br .DE \fR .SH NOTES .PP Out of the GDAL data types, the closest match for GRASS CELL, FCELL and DCELL rasters are respectively Int32, Float32 and Float64. These are not exact equivalents, but they will preserve the maximum possible data range and number of decimal places for each respective GRASS raster data type. Please keep in mind that not all CELL rasters will require Int32 - e.g., 0-255 CELL raster are covered by the Byte \fItype\fR as well. Moreover, some GDAL-supported formats do not support all the data types possible in GDAL and GRASS. Use \fIr.info\fR to check the data type and range for your GRASS raster, refer to specific format documentation (on the GDAL website), format vendor's documentation, and e.g. the Wikipedia article \fI Typical boundaries of primitive integral types\fR for details. .SS Ranges of GDAL data types \fC .DS .br GDAL data type minimum maximum .br .br Byte 0 255 .br UInt16 0 65,535 .br Int16, CInt16 -32,768 32,767 .br UInt32 0 4,294,967,295 .br Int32, CInt32 -2,147,483,648 2,147,483,647 .br Float32, CFloat32 -3.4E38 3.4E38 .br Float64, CFloat64 -1.79E308 1.79E308 .br .DE \fR .PP If there is a need to keep file sizes small, use the simplest data type covering the data range of the raster(s) to be exported, e.g., if suitable use Byte rather than UInt16; use Int16 rather than Int32; or use Float32 rather than Float64. In addition, the COMPRESS \fBcreateopt\fR used can have a very large impact on the size of the output file. .PP Some software may not recognize all of the compression methods available for a given file format, and certain compression methods may only be supported for certain data types (depends on vendor and version). .PP If the export settings are set such that data loss would occur in the output file (i.e, due to the particular choice of data type and/or file type), the normal behaviour of \fIr.out.gdal\fR in this case would be to issue an error message describing the problem and exit without exporting. The \fB-f\fR flag allows raster export even if some of the data loss tests are not passed, and warnings are issued instead of errors. .PP \fIr.out.gdal\fR exports may appear all black or gray on initial display in other GIS software. This is not a bug of \fIr.out.gdal\fR, but often caused by the default color table assigned by that software. The default color table may be grayscale covering the whole range of possible values which is very large for e.g. Int32 or Float32. E.g. stretching the color table to actual min/max would help (sometimes under symbology). .SS GeoTIFF caveats GeoTIFF exports can only be displayed by standard image viewers if the GDAL data type was set to Byte and the GeoTIFF contains either one or three bands. All other data types and numbers of bands can be properly read with GIS software only. Although GeoTIFF files usually have a .tif extension, these files are not necessarily images but first of all spatial raster datasets, e.g. SRTM DEM version 4. .PP When writing out multi-band GeoTIFF images for users of ESRI software or ImageMagick, the interleaving mode should be set to "pixel" using \fIcreateopt="INTERLEAVE=PIXEL"\fR. BAND interleaving is slightly more efficient, but not supported by some applications. This issue only arises when writing out multi-band imagery groups. .PP .SS Improving GeoTIFF compatibility To create a GeoTIFF that is highly compatible with various other GIS software packages, it is recommended to keep the GeoTIFF file as simple as possible. You will have to experiment with which options your software is compatible with, as this varies widely between vendors and versions. Long term, the less metadata you have to remove the more self-documenting (and useful) the dataset will be. .PP Here are some things to try: .RS .IP Create a World file with createopt="TFW=YES". .IP Do not use GeoTIFF internal compression. Other GIS software often supports only a subset of the available compression methods with the supported methods differing between GIS software packages. Unfortunately this means the output image can be rather huge, but the file can be compressed with software like zip, gnuzip, or bzip2. .IP Skip exporting the color table. Color tables are not always properly rendered, particularly for type UInt16, and the GeoTIFF file can appear completely black. If you are lucky the problematic software package has a method to reset the color table and assign a new color table (sometimes called symbology). .IP Keep metadata simple with createopt="PROFILE=GeoTIFF" or createopt="PROFILE=BASELINE". With BASELINE no GDAL or GeoTIFF tags will be written and a World file is required (\fIcreateopt="TFW=YES"\fR). .IP Adding overviews with gdaladdo after exporting can speed up display. Note that other software might create their own overviews, ignoring existing overviews. .RE .SH EXAMPLES .SS Export the integer raster roads map to GeoTIFF format: \fC .DS .br r.out.gdal input=roads output=roads.tif type=UInt16 .br .DE \fR .PP .SS Export a DCELL raster map in GeoTIFF format suitable for ESRI software: \fC .DS .br r.out.gdal in=elevation.10m out=ned_elev10m.tif type=Float64 createopt="PROFILE=GeoTIFF,TFW=YES" .br .DE \fR .PP .SS Export R,G,B imagery bands in GeoTIFF format suitable for ESRI software: \fC .DS .br i.group group=nc_landsat_rgb input=lsat7_2002_30,lsat7_2002_20,lsat7_2002_10 .br r.out.gdal in=nc_landsat_rgb out=nc_landsat_rgb.tif type=Byte createopt="PROFILE=GeoTIFF,INTERLEAVE=PIXEL,TFW=YES" .br .DE \fR .PP .SS Export the floating point raster elevation map to ERDAS/IMG format: \fC .DS .br r.out.gdal input=elevation.10m output=elev_dem10.img format=HFA type=Float32 .br .DE \fR .SS Export group of image maps as multi-band file \fC .DS .br g.list group .br i.group group=tm7 subgroup=tm7 input=tm7_10,tm7_20,tm7_30,tm7_40,tm7_50,tm7_60,tm7_70 .br i.group -l tm7 .br r.out.gdal tm7 type=UInt16 out=lsat_multiband.tif .br gdalinfo lsat_multiband.tif .br .DE \fR .SH GDAL RELATED ERROR MESSAGES .RS .IP "ERROR 6: SetColorInterpretation() not supported for this dataset.": This \fImay\fR indicate that the color table was not written properly. But usually it will be correct and the message can be ignored. .IP "ERROR 6: SetNoDataValue() not supported for this dataset.": The selected output format does not support "no data". It is recommended to use a different output format if your data contains NULLs. .IP "Warning 1: Lost metadata writing to GeoTIFF ... too large to fit in tag.": The color table metadata may be too large. It is recommended to simplify or not write the color table, or use a different output format. .RE .SH SEE ALSO The GDAL supported formats page. .br \fI r.out.ascii, r.out.arc, r.out.bin, r.out.mat, r.out.png, r.out.ppm, r.out.tiff .br r.out.gdal.sh\fR (old shell script version using gdal_translate) .SH REFERENCES GDAL Pages: http://www.gdal.org .SH AUTHORS Vytautas Vebra (oliver4grass at gmail.com) .br Markus Metz (improved nodata logic) .PP \fILast changed: $Date: 2010-09-16 09:25:59 +0200 (Thu, 16 Sep 2010) $\fR .PP Full index .PP © 2003-2011 GRASS Development Team