1r.in.gdal(1)                  Grass User's Manual                 r.in.gdal(1)
2
3
4

NAME

6       r.in.gdal  - Import GDAL supported raster file into a binary raster map
7       layer.
8

KEYWORDS

10       raster, import
11

SYNOPSIS

13       r.in.gdal
14       r.in.gdal help
15       r.in.gdal  [-oefk]    [input=name]     [output=name]     [band=integer]
16       [target=string]    [title="phrase"]   [location=string]   [--overwrite]
17       [--verbose]  [--quiet]
18
19   Flags:
20       -o
21           Override projection (use location's projection)
22
23       -e
24           Extend location extents based on new dataset
25
26       -f
27           List supported formats and exit
28
29       -k
30           Keep band numbers instead of using band color names
31
32       --overwrite
33           Allow output files to overwrite existing files
34
35       --verbose
36           Verbose module output
37
38       --quiet
39           Quiet module output
40
41   Parameters:
42       input=name
43           Raster file to be imported
44
45       output=name
46           Name for output raster map
47
48       band=integer
49           Band to select (default is all bands)
50
51       target=string
52           Name of location to read projection from for GCPs transformation
53
54       title=
55           Title for resultant raster map
56
57       location=string
58           Name for new location to create
59

DESCRIPTION

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

OPTIONS

67       Extended explanations:
68
69   Flags:
70       -e
71              Extend  the  DEFAULT_WIND  in  PERMANENT  mapset  to include the
72              region of the new map layer.  Old resolution is  preserved,  but
73              the  region,  and  rows/cols are updated.  This will fail if the
74              user doesn't have write access to the PERMANENT mapset.
75

GDAL supported raster formats

77       Full details on GDAL supported formats are available at:
78
79       http://www.gdal.org/formats_list.html
80
81       Selected formats of more than 45 supported formats:
82       Long    Format     Name                                            Code
83       Creation        Georeferencing          Maximum File Size
84       Arc/Info    ASCII    Grid                                       AAIGrid
85       Yes             Yes                     No limits
86       Arc/Info     Binary     Grid                                        AIG
87       No              Yes                     --
88       AIRSAR      Polarimetric                                         AIRSAR
89       No              No                      --
90       Microsoft   Windows   Device   Independent   Bitmap   (.bmp)        BMP
91       Yes             Yes                     4GiB
92       BSB    Nautical    Chart   Format   (.kap)                          BSB
93       No              Yes                     --
94       VTP   Binary   Terrain    Format    (.bt)                            BT
95       Yes             Yes                     --
96       CEOS    (Spot    for    instance)                                  CEOS
97       No              No                      --
98       First   Generation   USGS   DOQ   (.doq)                           DOQ1
99       No              Yes                     --
100       New    Labelled   USGS   DOQ   (.doq)                              DOQ2
101       No              Yes                     --
102       Data    (.dt0,     .dt1)                                           DTED
103       No              Yes                     --
104       ERMapper    Compressed    Wavelets    (.ecw)                        ECW
105       Yes             Yes
106       ESRI    .hdr     Labelled                                          EHdr
107       No              Yes                     --
108       ENVI    .hdr    Labelled    Raster                                 ENVI
109       Yes             Yes                     No limits
110       Envisat   Image   Product   (.n1)                               Envisat
111       No              No                      --
112       EOSAT     FAST     Format                                          FAST
113       No              Yes                     --
114       FITS      (.fits)                                                  FITS
115       Yes             No
116       Graphics    Interchange    Format    (.gif)                         GIF
117       Yes             No                      2GB
118       Arc/Info    Binary    Grid    (.adf)                                GIO
119       Yes             Yes
120       GRASS      Rasters                                                GRASS
121       No              Yes                     --
122       TIFF   /   GeoTIFF    (.tif)                                      GTiff
123       Yes             Yes                     4GiB
124       Hierarchical   Data   Format   Release   4   (HDF4)                HDF4
125       Yes             Yes                     2GiB
126       Erdas     Imagine     (.img)                                        HFA
127       Yes             Yes                     No limits
128       Atlantis       MFF2e                                                HKV
129       Yes             Yes                     No limits
130       Image   Display   and   Analysis    (WinDisp)                       IDA
131       Yes             Yes                     2GB
132       ILWIS    Raster    Map   (.mpr,.mpl)                              ILWIS
133       Yes             Yes                     --
134       Japanese    DEM     (.mem)                                         JDEM
135       No              Yes                     --
136       JPEG     JFIF     (.jpg)                                           JPEG
137       Yes               Yes                        4GiB    (max    dimentions
138       65500x65500)
139       JPEG2000    (.jp2,   .j2k)                                     JPEG2000
140       Yes             Yes                     2GiB
141       JPEG2000    (.jp2,    .j2k)                                      JP2KAK
142       Yes             Yes                     No limits
143       NOAA   Polar   Orbiter   Level   1b  Data  Set  (AVHRR)             L1B
144       No              Yes                     --
145       Erdas   7.x   .LAN   and    .GIS                                    LAN
146       No              Yes                     2GB
147       In     Memory     Raster                                            MEM
148       Yes             Yes                     2GiB
149       Atlantis       MFF                                                  MFF
150       Yes             Yes                     No limits
151       Multi-resolution    Seamless    Image   Database                  MrSID
152       No              Yes                     --
153       NDF                                                     NLAPS Data For‐
154       mat       No              Yes                     No limits
155       NITF                                                               NITF
156       Yes             Yes
157       NetCDF                                                           netCDF
158       Yes             Yes                     2GB
159       OGDI       Bridge                                                  OGDI
160       No              Yes                     --
161       PCI    .aux     Labelled                                           PAux
162       Yes             No                      No limits
163       PCI    Geomatics   Database   File                               PCIDSK
164       Yes             Yes                     No limits
165       Portable    Network    Graphics    (.png)                           PNG
166       Yes             No
167       PCRaster     (.map)                                            PCRaster
168       Yes             No
169       Netpbm       (.ppm,.pgm)                                            PNM
170       Yes             No                      No limits
171       RadarSat2     XML     (product.xml)                                 RS2
172       No              Yes                     4GB
173       USGS   SDTS    DEM    (*CATD.DDF)                                  SDTS
174       No              Yes                     --
175       SAR     CEOS                                                   SAR_CEOS
176       No              Yes                     --
177       USGS   ASCII   DEM   (.dem)                                     USGSDEM
178       No              Yes                     --
179       X11     Pixmap     (.xpm)                                           XPM
180       Yes             No
181
182

Location Creation

184       r.in.gdal attempts to preserve projection  information  when  importing
185       datasets  if  the source format includes projection information, and if
186       the GDAL driver supports it.  If the projection of the  source  dataset
187       does  not  match  the projection of the current location r.in.gdal will
188       report an error message (Projection of dataset does not appear to match
189       current  location)  and  then  report  the  PROJ_INFO parameters of the
190       source dataset.
191
192       If the user wishes to ignore the difference between the apparent  coor‐
193       dinate  system  of  the  source data and the current location, they may
194       pass the -o flag to override the projection check.
195
196       If the user wishes to import the data with the full projection  defini‐
197       tion, it is possible to have r.in.gdal automatically create a new loca‐
198       tion based on the projection and extents of the file being read.   This
199       is accomplished by passing the name to be used for the new location via
200       the location parameter.  Upon completion of the command, a new location
201       will  have  been created (with only a PERMANENT mapset), and the raster
202       will have been imported with the indicated output name into the  PERMA‐
203       NENT mapset.
204
205       Support for GCPs: In case the image contains GCPs they are written to a
206       POINTS file within an imagery group. They  can  directly  be  used  for
207       i.rectify.  The  target  option  allows to automatically re-project the
208       GCPs from their own projection into another projection  read  from  the
209       PROJ_INFO file of the location name target.
210

NOTES

212       I  plan  to  make  a variety of improvements to r.in.gdal in the future
213       including support for reporting everything known about a dataset if the
214       output parameter is not set.
215
216       The  r.in.gdal  comand  does support the following features, as long as
217       the underlying format driver supports it:
218
219        Color Table
220               Bands with associated colortables will have  the  color  tables
221              transferred.  Note that if the source has no colormap, r.in.gdal
222              in GRASS 5.0  will  emit  no  colormap.   Use  r.colors  map=...
223              color=grey  to assign a greyscale colormap.  In a future version
224              of GRASS r.in.gdal will likely be upgraded to automatically emit
225              greyscale colormaps.
226
227        Data Types
228               Most  GDAL  data types are supported.  Float32 and Float64 type
229              bands are translated as GRASS floating point cells (but not dou‐
230              ble  precision  ...   this  could  be added if needed), and most
231              other  types  are  translated  as  GRASS  integer  cells.   This
232              includes  16bit  integer data sources.  Complex (some SAR signal
233              data formats) data bands are translated to  two  floating  point
234              cell layers (*.real and *.imaginary).
235
236        Georeferencing
237               If the dataset has affine georeferencing information, this will
238              be used to set the north, south, east  and  west  edges.   Rota‐
239              tional  coefficients  will  be  ignored,  resulting in incorrect
240              positioning for rotated datasets.
241
242        Projection
243               The datasets projection will be used to compare to the  current
244              location  or  to  define a new location.  Internally GDAL repre‐
245              sents projections in OpenGIS Well Known Text  format.   A  large
246              subset of the total set of GRASS projections are supported.
247
248        Null Values
249               Raster  bands for which a null value is recognised by GDAL will
250              have the null pixels transformed into GRASS style  nulls  during
251              import.   Many  generic formats (and formats poorly supported by
252              GDAL) do not have a way of recognising null pixels in which case
253              r.null should be used after the import.
254
255        GCPs
256               Datasets  that  have  Ground  Control  Points  will  have  them
257              imported as a POINTS file associated  with  the  imagery  group.
258              Datasets  with  only  one  band  that  would otherwise have been
259              translated as a simple raster map will also have  an  associated
260              imagery  group  if there are ground control points.  The coordi‐
261              nate  system  of  the  ground  control  points  is  reported  by
262              r.in.gdal  but  not  preserved.   It is up to the user to ensure
263              that the location established with  i.target  has  a  compatible
264              coordinate system before using the points with i.rectify.
265

EXAMPLES

267   GTOPO30 DEM
268       To  avoid that the GTOPO30 data are read incorrectly, you can add a new
269       line "PIXELTYPE SIGNEDINT" in the .HDR to force interpretation  of  the
270       file as signed rather than unsigned integers. Then the .DEM file can be
271       imported.  Finally, e.g. the 'terrain' color table can be  assigned  to
272       the imported map with r.colors.
273
274   GLOBE DEM
275       To  import  GLOBE DEM tiles (approx 1km resolution, better than GTOPO30
276       DEM data), the user  has  to  download  additionally  the  related  HDR
277       file(s).   Finally,  e.g.  the 'terrain' color table can be assigned to
278       the imported map with r.colors.
279
280   Worldclim.org
281       To import Worldclim data, the following line has to be  added  to  each
282       .hdr file:
283       PIXELTYPE SIGNEDINT
284
285
286   HDF
287       The  import  of  HDF bands requires the specification of the individual
288       bands as seen by GDAL:
289       # Example MODIS FPAR
290       gdalinfo MOD15A2.A2003153.h18v04.004.2003171141042.hdf
291       Subdatasets:
292         SUB‐
293       DATASET_1_NAME=HDF4_EOS:EOS_GRID:"MOD15A2.A2003153.h18v04.004.2003171141042.hdf":MOD_Grid_MOD15A2:Fpar_1km
294         SUBDATASET_1_DESC=[1200x1200]   Fpar_1km   MOD_Grid_MOD15A2    (8-bit
295       unsigned integer)
296         SUB‐
297       DATASET_2_NAME=HDF4_EOS:EOS_GRID:"MOD15A2.A2003153.h18v04.004.2003171141042.hdf":MOD_Grid_MOD15A2:Lai_1km
298         SUBDATASET_2_DESC=[1200x1200]    Lai_1km    MOD_Grid_MOD15A2   (8-bit
299       unsigned integer)
300       # import of first band, here FPAR 1km:
301       r.in.gdal
302       HDF4_EOS:EOS_GRID:"MOD15A2.A2003153.h18v04.004.2003171141042.hdf":MOD_Grid_MOD15A2:Fpar_1km
303       \
304                 out=fpar_1km_2003_06_02
305       # ... likewise for other HDF bands in the file.
306
307

NOTES

309       "ERROR: Input map is rotated - cannot import."
310       In this case the image must be first externally rotated,  applying  the
311       rotation  info  stored  in the metadata field of the raster image file.
312       For example, the gdalwarp  software can be used to transform the map to
313       North-up  (note,  there  are  several gdalwarp parameters to select the
314       resampling algorithm):
315       gdalwarp rotated.tif northup.tif
316
317
318       "ERROR: Projection of dataset does not  appear  to  match  the  current
319       location."
320       You  need  to  create  a location whose projection matches the data you
321       wish to import. Try using location parameter to create a  new  location
322       based  upon the projection information in the file. If desired, you can
323       then re-project it to another location with r.proj.
324

SEE ALSO

326        r.colors, r.in.ascii, r.in.arc, r.in.bin, r.null
327

REFERENCES

329       GDAL Pages: http://www.gdal.org/
330

AUTHOR

332       email).
333
334       Last changed: $Date: 2008-02-24 16:20:10 +0100 (Sun, 24 Feb 2008) $
335
336       Full index
337
338       © 2003-2008 GRASS Development Team
339
340
341
342GRASS 6.3.0                                                       r.in.gdal(1)
Impressum