.TH r.in.gdal 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBr.in.gdal\fR\fR - Import GDAL supported raster file into a binary raster map layer. .SH KEYWORDS raster, import .SH SYNOPSIS \fBr.in.gdal\fR .br \fBr.in.gdal help\fR .br \fBr.in.gdal\fR [\-\fBoeflk\fR] [\fBinput\fR=\fIname\fR] [\fBoutput\fR=\fIname\fR] [\fBband\fR=\fIinteger\fR] [\fBmemory\fR=\fIinteger\fR] [\fBtarget\fR=\fIname\fR] [\fBtitle\fR=\fI"phrase"\fR] [\fBlocation\fR=\fIname\fR] [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-o\fR" 4m .br Override projection (use location's projection) .IP "\fB\-e\fR" 4m .br Extend region extents based on new dataset .br Also updates the default region if in the PERMANENT mapset .IP "\fB\-f\fR" 4m .br List supported formats and exit .IP "\fB\-l\fR" 4m .br Force Lat/Lon maps to fit into geographic coordinates (90N,S; 180E,W) .IP "\fB\-k\fR" 4m .br Keep band numbers instead of using band color names .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .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 Raster file to be imported .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output raster map .IP "\fBband\fR=\fIinteger\fR" 4m .br Band to select (default is all bands) .IP "\fBmemory\fR=\fIinteger\fR" 4m .br Cache size (MiB) .IP "\fBtarget\fR=\fIname\fR" 4m .br Name of location to read projection from for GCPs transformation .IP "\fBtitle\fR=\fI"phrase"\fR" 4m .br Title for resultant raster map .IP "\fBlocation\fR=\fIname\fR" 4m .br Name for new location to create .PP .SH DESCRIPTION \fIr.in.gdal\fR allows a user to create a (binary) GRASS raster map layer, or imagery group, from any GDAL supported raster map format, with an optional title. The imported file may also be optionally used to create a new location. .SH OPTIONS Extended explanations: .SS Flags: .IP "\fB\-e\fR .br Extend the DEFAULT_WIND in PERMANENT mapset to include the region of the new map layer. Old resolution is preserved, but the region, and rows/cols are updated. This will fail if the user doesn't have write access to the PERMANENT mapset. .SS GDAL supported raster formats Full details on GDAL supported formats are available at: .PP http://www.gdal.org/formats_list.html .PP Selected formats of the more than 80 supported formats: \fC .DS .br .br Long Format Name Code Creation Georeferencing Maximum File Size .br .br Arc/Info ASCII Grid AAIGrid Yes Yes No limits .br Arc/Info Binary Grid AIG No Yes -- .br AIRSAR Polarimetric AIRSAR No No -- .br Microsoft Windows Device Independent Bitmap (.bmp) BMP Yes Yes 4GiB .br BSB Nautical Chart Format (.kap) BSB No Yes -- .br VTP Binary Terrain Format (.bt) BT Yes Yes -- .br CEOS (Spot for instance) CEOS No No -- .br First Generation USGS DOQ (.doq) DOQ1 No Yes -- .br New Labelled USGS DOQ (.doq) DOQ2 No Yes -- .br Data (.dt0, .dt1) DTED No Yes -- .br ERMapper Compressed Wavelets (.ecw) ECW Yes Yes .br ESRI .hdr Labelled EHdr No Yes -- .br ENVI .hdr Labelled Raster ENVI Yes Yes No limits .br Envisat Image Product (.n1) Envisat No No -- .br EOSAT FAST Format FAST No Yes -- .br FITS (.fits) FITS Yes No .br Graphics Interchange Format (.gif) GIF Yes No 2GB .br Arc/Info Binary Grid (.adf) GIO Yes Yes .br GRASS Rasters GRASS No Yes -- .br TIFF / GeoTIFF (.tif) GTiff Yes Yes 4GiB .br Hierarchical Data Format Release 4 (HDF4) HDF4 Yes Yes 2GiB .br Erdas Imagine (.img) HFA Yes Yes No limits .br Atlantis MFF2e HKV Yes Yes No limits .br Image Display and Analysis (WinDisp) IDA Yes Yes 2GB .br ILWIS Raster Map (.mpr,.mpl) ILWIS Yes Yes -- .br Japanese DEM (.mem) JDEM No Yes -- .br JPEG JFIF (.jpg) JPEG Yes Yes 4GiB (max dimentions 65500x65500) .br JPEG2000 (.jp2, .j2k) JPEG2000 Yes Yes 2GiB .br JPEG2000 (.jp2, .j2k) JP2KAK Yes Yes No limits .br NOAA Polar Orbiter Level 1b Data Set (AVHRR) L1B No Yes -- .br Erdas 7.x .LAN and .GIS LAN No Yes 2GB .br In Memory Raster MEM Yes Yes 2GiB .br Atlantis MFF MFF Yes Yes No limits .br Multi-resolution Seamless Image Database MrSID No Yes -- .br NDF NLAPS Data Format No Yes No limits .br NITF NITF Yes Yes .br NetCDF netCDF Yes Yes 2GB .br OGDI Bridge OGDI No Yes -- .br PCI .aux Labelled PAux Yes No No limits .br PCI Geomatics Database File PCIDSK Yes Yes No limits .br Portable Network Graphics (.png) PNG Yes No .br PCRaster (.map) PCRaster Yes No .br Netpbm (.ppm,.pgm) PNM Yes No No limits .br RadarSat2 XML (product.xml) RS2 No Yes 4GB .br USGS SDTS DEM (*CATD.DDF) SDTS No Yes -- .br SAR CEOS SAR_CEOS No Yes -- .br USGS ASCII DEM (.dem) USGSDEM No Yes -- .br X11 Pixmap (.xpm) XPM Yes No .br .DE \fR .SS Location Creation \fIr.in.gdal\fR 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 \fIr.in.gdal\fR 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. .PP 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 \fB-o\fR flag to override the projection check. .PP 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 \fBlocation\fR 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 \fBoutput\fR name into the PERMANENT mapset. .PP Support for GCPs: In case the image contains GCPs they are written to a POINTS file within an imagery group. They can directly be used for i.rectify. The \fBtarget\fR option allows you to automatically re-project the GCPs from their own projection into another projection read from the PROJ_INFO file of the location name \fBtarget\fR. .SH NOTES Import of large files can be significantly faster when setting \fBmemory\fR to the size of the input file. .PP The \fIr.in.gdal\fR command does support the following features, as long as the underlying format driver supports it: .PP .IP " Color Table .br Bands with associated colortables will have the color tables transferred. Note that if the source has no colormap, r.in.gdal in GRASS 5.0 will emit no colormap. Use r.colors map=... color=grey to assign a greyscale colormap. In a future version of GRASS r.in.gdal will likely be upgraded to automatically emit greyscale colormaps. .br .IP " Data Types .br 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 most other types are translated as GRASS integer cells. This includes 16bit integer data sources. Complex (some SAR signal data formats) data bands are translated to two floating point cell layers (*.real and *.imaginary). .br .IP " Georeferencing .br 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. .br .IP " Projection .br 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. .br .IP " Null Values .br Raster bands for which a null value is recognised by GDAL will have the null pixels transformed into GRASS style nulls during import. Many generic formats (and formats poorly supported by GDAL) do not have a way of recognising null pixels in which case r.null should be used after the import. .br .IP " GCPs .br Datasets that have Ground Control Points will have them imported as a POINTS file associated with the imagery group. Datasets with only one band that would otherwise have been translated as a simple raster map will also have an associated imagery group if there are ground control points. The coordinate system of the ground control points is reported by r.in.gdal but not preserved. It is up to the user to ensure that the location established with i.target has a compatible coordinate system before using the points with i.rectify. .br .PP .PP Planned improvements to \fIr.in.gdal\fR in the future include support for reporting everything known about a dataset if the \fBoutput\fR parameter is not set. .SS Error Messages \fI"ERROR: Input map is rotated - cannot import."\fR .br In this case the image must be first externally rotated, applying the rotation info stored in the metadata field of the raster image file. For example, the gdalwarp software can be used to transform the map to North-up (note, there are several gdalwarp parameters to select the resampling algorithm): \fC .DS .br gdalwarp rotated.tif northup.tif .br .DE \fR .PP \fI"ERROR: Projection of dataset does not appear to match the current location."\fR .br You need to create a location whose projection matches the data you wish to import. Try using \fBlocation\fR parameter to create a new location based upon the projection information in the file. If desired, you can then re-project it to another location with \fIr.proj\fR. Alternatively you can override this error by using the \fB-o\fR flag. .PP \fI"WARNING: G_set_window(): Illegal latitude for North"\fR .br Latitude/Longitude locations in GRASS can not have regions which exceed 90° North or South. Non-georeferenced imagery will have coordinates based on the images's number of pixels: 0,0 in the bottom left; cols,rows in the top right. Typically imagery will be much more than 90 pixels tall and so the GIS refuses to import it. If you are sure that the data is appropriate for your Lat/Lon location and intentd to reset the map's bounds with the \fIr.region\fR module directly after import you may use the \fB-l\fR flag to constrain the map coordinates to legal values. While the resulting bounds and resolution will likely be wrong for your map the map's data will be unaltered and safe. After resetting to known bounds with \fIr.region\fR you should double check them with \fIr.info\fR, paying special attention to the map resolution. In most cases you will want to import into the datafile's native projection, or into a simple XY location and use the Georectifaction tools (\fIi.rectify\fR et al.) to properly project into the target location. The \fB-l\fR flag should \fIonly\fR be used if you know the projection is correct but the internal georeferencing has gotten lost, and you know the what the map's bounds and resolution should be beforehand. .SH EXAMPLES .SS GTOPO30 DEM To avoid that the GTOPO30 data are read incorrectly, you can add a new line \(dqPIXELTYPE SIGNEDINT" in the .HDR to force interpretation of the file as signed rather than unsigned integers. Then the .DEM file can be imported. Finally, e.g. the 'terrain' color table can be assigned to the imported map with \fIr.colors\fR. .SS GLOBE DEM To import GLOBE DEM tiles (approx 1km resolution, better than GTOPO30 DEM data), the user has to download additionally the related HDR file(s). Finally, e.g. the 'terrain' color table can be assigned to the imported map with \fIr.colors\fR. .SS Worldclim.org To import Worldclim data, the following line has to be added to each .hdr file: \fC .DS .br PIXELTYPE SIGNEDINT .br .DE \fR .SS HDF The import of HDF bands requires the specification of the individual bands as seen by GDAL: \fC .DS .br # Example MODIS FPAR .br gdalinfo MOD15A2.A2003153.h18v04.004.2003171141042.hdf .br ... .br Subdatasets: .br SUBDATASET_1_NAME=HDF4_EOS:EOS_GRID:"MOD15A2.A2003153.h18v04.004.2003171141042.hdf":MOD_Grid_MOD15A2:Fpar_1km .br SUBDATASET_1_DESC=[1200x1200] Fpar_1km MOD_Grid_MOD15A2 (8-bit unsigned integer) .br SUBDATASET_2_NAME=HDF4_EOS:EOS_GRID:"MOD15A2.A2003153.h18v04.004.2003171141042.hdf":MOD_Grid_MOD15A2:Lai_1km .br SUBDATASET_2_DESC=[1200x1200] Lai_1km MOD_Grid_MOD15A2 (8-bit unsigned integer) .br ... .br .br # import of first band, here FPAR 1km: .br r.in.gdal HDF4_EOS:EOS_GRID:"MOD15A2.A2003153.h18v04.004.2003171141042.hdf":MOD_Grid_MOD15A2:Fpar_1km \(rs .br out=fpar_1km_2003_06_02 .br # ... likewise for other HDF bands in the file. .br .DE \fR .SH SEE ALSO \fI r.colors, r.in.ascii, r.in.arc, r.in.bin, r.null \fR .SH REFERENCES GDAL Pages: http://www.gdal.org/ .br .SH AUTHOR Frank Warmerdam (email). .PP \fILast changed: $Date: 2013-04-18 07:56:53 +0200 (Thu, 18 Apr 2013) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team