1r.in.gdal(1) Grass User's Manual r.in.gdal(1)
2
3
4
6 r.in.gdal - Import GDAL supported raster file into a binary raster map
7 layer.
8
10 raster
11
13 r.in.gdal
14 r.in.gdal help
15 r.in.gdal [-oefk] input=string output=name [band=integer] [tar‐
16 get=string] [title="phrase"] [location=string] [--overwrite]
17
18 Flags:
19 -o Override projection (use location's projection)
20
21 -e Extend location extents based on new dataset
22
23 -f List supported formats then exit
24
25 -k Keep band numbers instead of using band color names
26
27 --overwrite
28
29 Parameters:
30 input=string
31 Raster file to be imported
32
33 output=name
34 Name for output raster map
35
36 band=integer
37 Band to select (default is all bands)
38
39 target=string
40 Name of location to read projection from for GCPs transformation
41
42 title=
43 Title for resultant raster map
44
45 location=string
46 Name for new location to create
47
49 r.in.gdal allows a user to create a (binary) GRASS raster map layer, or
50 imagery group, from any GDAL supported raster map format, with an
51 optional title. The imported file may also be optionally used to cre‐
52 ate a new location.
53
55 Extended explanations:
56
57 Flags:
58 -e Extend the DEFAULT_WIND in PERMANENT mapset to include the
59 region of the new map layer. Old resolution is preserved, but
60 the region, and rows/cols are updated. This will fail if the
61 user doesn't have write access to the PERMANENT mapset.
62
64 Full details on GDAL supported formats are available at:
65
66 http://www.gdal.org/formats_list.html
67
68 Selected formats of more than 40 supported formats: Long Format Name
69 Code Creation Georeferencing Maximum file size | Arc/Info ASCII Grid |
70 AAIGrid | Yes | Yes | No limits | Arc/Info Binary Grid (.adf) |
71 AIG | No | Yes | -- | AIRSAR Polarimetric | AIRSAR | No | No |
72 -- | Microsoft Windows Device Independent Bitmap (.bmp) | BMP | Yes
73 | Yes | 4GiB | BSB Nautical Chart Format (.kap) | BSB | No | Yes
74 | -- | VTP Binary Terrain Format (.bt) | BT | Yes | Yes | -- |
75 CEOS (Spot for instance) | CEOS | No | No | -- | First Generation
76 USGS DOQ (.doq) | DOQ1 | No | Yes | -- | New Labelled USGS DOQ
77 (.doq) | DOQ2 | No | Yes | -- | Military Elevation Data (.dt0,
78 .dt1) | DTED | No | Yes | -- | ERMapper Compressed Wavelets (.ecw)
79 | ECW | Yes | Yes |
80 | ESRI .hdr Labelled | EHdr | No | Yes | -- | ENVI .hdr Labelled
81 Raster | ENVI | Yes | Yes | No limits | Envisat Image Product
82 (.n1) | Envisat | No | No | -- | EOSAT FAST Format | FAST | No |
83 Yes | -- | FITS (.fits) | FITS | Yes | No |
84 | Graphics Interchange Format (.gif) | GIF | Yes | No | 2GB |
85 Arc/Info Binary Grid (.adf) | GIO | Yes | Yes |
86 | GRASS Rasters | GRASS | No | Yes | -- | TIFF / GeoTIFF (.tif) |
87 GTiff | Yes | Yes | 4GiB | Hierarchical Data Format Release 4
88 (HDF4) | HDF4 | Yes | Yes | 2GiB | Erdas Imagine (.img) | HFA |
89 Yes | Yes | No limits | Atlantis MFF2e | HKV | Yes | Yes | No
90 limits | Image Display and Analysis (WinDisp) | IDA | Yes | Yes |
91 2GB | ILWIS Raster Map (.mpr,.mpl) | ILWIS | Yes | Yes | -- | Ja‐
92 panese DEM (.mem) | JDEM | No | Yes | -- | JPEG JFIF (.jpg) |
93 JPEG | Yes | Yes | 4GiB (max dimentions 65500x65500) | JPEG2000
94 (.jp2, .j2k) | JPEG2000 | Yes | Yes | 2GiB | JPEG2000 (.jp2, .j2k)
95 | JP2KAK | Yes | Yes | No limits | NOAA Polar Orbiter Level 1b
96 Data Set (AVHRR) | L1B | No | Yes | -- | Erdas 7.x .LAN and .GIS |
97 LAN | No | Yes | 2GB | In Memory Raster | MEM | Yes | Yes |
98 2GiB | Atlantis MFF | MFF | Yes | Yes | No limits | Multi-resolu‐
99 tion Seamless Image Database | MrSID | No | Yes | -- | NDF |
100 NLAPS Data Format | No | Yes | No limits | NITF | NITF | Yes |
101 Yes |
102 | NetCDF | netCDF | Yes | Yes | 2GB | OGDI Bridge | OGDI | No |
103 Yes | -- | PCI .aux Labelled | PAux | Yes | No | No limits | PCI
104 Geomatics Database File | PCIDSK | Yes | Yes | No limits | Porta‐
105 ble Network Graphics (.png) | PNG | Yes | No |
106 | PCRaster (.map) | PCRaster | Yes | No |
107 | Netpbm (.ppm,.pgm) | PNM | Yes | No | No limits | RadarSat2 XML
108 (product.xml) | RS2 | No | Yes | 4GB | USGS SDTS DEM (*CATD.DDF) |
109 SDTS | No | Yes | -- | SAR CEOS | SAR_CEOS | No | Yes | -- |
110 USGS ASCII DEM (.dem) | USGSDEM | No | Yes | -- | X11 Pixmap
111 (.xpm) | XPM | Yes | No |
112
114 r.in.gdal attempts to preserve projection information when importing
115 datasets if the source format includes projection information, and if
116 the GDAL driver supports it. If the projection of the source dataset
117 does not match the projection of the current location r.in.gdal will
118 report an error message (Projection of dataset does not appear to match
119 current location) and then report the PROJ_INFO parameters of the
120 source dataset.
121
122 If the user wishes to ignore the difference between the apparent coor‐
123 dinate system of the source data and the current location, they may
124 pass the -o flag to override the projection check.
125
126 If the user wishes to import the data with the full projection defini‐
127 tion, it is possible to have r.in.gdal automatically create a new loca‐
128 tion based on the projection and extents of the file being read. This
129 is accomplished by passing the name to be used for the new location via
130 the location parameter. Upon completion of the command, a new location
131 will have been created (with only a PERMANENT mapset), and the raster
132 will have been imported with the indicated output name into the PERMA‐
133 NENT mapset.
134
135 Support for GCPs: In case the image contains GCPs they are written to a
136 POINTS file within an imagery group. They can directly be used for
137 i.rectify. The target option allows to automatically re-project the
138 GCPs from their own projection into another projection read from the
139 PROJ_INFO file of the location name target.
140
142 I plan to make a variety of improvements to r.in.gdal in the future
143 including support for reporting everything known about a dataset if the
144 output parameter is not set.
145
146 The r.in.gdal comand does support the following features, as long as
147 the underlying format driver supports it:
148
149 Color Table
150 Bands with associated colortables will have the color tables
151 transferred. Note that if the source has no colormap, r.in.gdal
152 in GRASS 5.0 will emit no colormap. Use r.colors map=...
153 color=grey to assign a greyscale colormap. In a future version
154 of GRASS r.in.gdal will likely be upgraded to automatically emit
155 greyscale colormaps.
156
157 Data Types
158 Most GDAL data types are supported. Float32 and Float64 type
159 bands are translated as GRASS floating point cells (but not dou‐
160 ble precision ... this could be added if needed), and most
161 other types are translated as GRASS integer cells. This
162 includes 16bit integer data sources. Complex (some SAR signal
163 data formats) data bands are translated to two floating point
164 cell layers (*.real and *.imaginary).
165
166 Georeferencing
167 If the dataset has affine georeferencing information, this will
168 be used to set the north, south, east and west edges. Rota‐
169 tional coefficients will be ignored, resulting in incorrect
170 positioning for rotated datasets.
171
172 Projection
173 The datasets projection will be used to compare to the current
174 location or to define a new location. Internally GDAL repre‐
175 sents projections in OpenGIS Well Known Text format. A large
176 subset of the total set of GRASS projections are supported.
177
178 Null Values
179 Raster bands for which a null value is recognised by GDAL will
180 have the null pixels transformed into GRASS style nulls during
181 import. Many generic formats (and formats poorly supported by
182 GDAL) do not have a way of recognising null pixels in which case
183 r.null should be used after the import.
184
185 GCPs Datasets that have Ground Control Points will have them imported
186 as a POINTS file associated with the imagery group. Datasets
187 with only one band that would otherwise have been translated as
188 a simple raster map will also have an associated imagery group
189 if there are ground control points. The coordinate system of
190 the ground control points is reported by r.in.gdal but not pre‐
191 served. It is up to the user to ensure that the location estab‐
192 lished with i.target has a compatible coordinate system before
193 using the points with i.rectify.
194
196 GTOPO30 DEM
197 To avoid that the GTOPO30 data are read incorrectly, you can add a new
198 line "PIXELTYPE SIGNEDINT" in the .HDR to force interpretation of the
199 file as signed rather than unsigned integers. Then the .DEM file can be
200 imported. Finally, e.g. the 'terrain' color table can be assigned to
201 the imported map with r.colors.
202
203 GLOBE DEM
204 To import GLOBE DEM tiles (approx 1km resolution, better than GTOPO30
205 DEM data), the user has to download additionally the related HDR
206 file(s). Finally, e.g. the 'terrain' color table can be assigned to
207 the imported map with r.colors.
208
209 Worldclim.org
210 To import Worldclim data, the following line has to be added to each
211 .hdr file:
212 PIXELTYPE SIGNEDINT
213
214
216 "ERROR: Input map is rotated - cannot import."
217 In this case the image must be first externally rotated, applying the
218 rotation info stored in the metadata field of the raster image file.
219 For example, the gdalwarp software can be used to transform the map to
220 North-up (note, there are several gdalwarp parameters to select the
221 resampling algorithm):
222 gdalwarp rotated.tif northup.tif
223
224
226 r.colors, r.in.ascii, r.in.arc, r.in.bin, r.null
227
229 GDAL Pages: http://www.gdal.org/
230
232 email).
233
234 Last changed: $Date: 2007/05/31 16:22:24 $
235
236 Full index
237
238
239
240GRASS 6.2.2 r.in.gdal(1)