1r.in.bin(1) Grass User's Manual r.in.bin(1)
2
3
4
6 r.in.bin - Import a binary raster file into a GRASS raster map layer.
7
9 raster, import
10
12 r.in.bin
13 r.in.bin --help
14 r.in.bin [-fdsbh] input=name output=name [title=phrase] [bytes=inte‐
15 ger] [header=integer] [bands=integer] [order=string]
16 [north=float] [south=float] [east=float] [west=float]
17 [rows=integer] [cols=integer] [anull=float]
18 [flip=string[,string,...]] [--overwrite] [--help] [--verbose]
19 [--quiet] [--ui]
20
21 Flags:
22 -f
23 Import as floating-point data (default: integer)
24
25 -d
26 Import as double-precision floating-point data (default: integer)
27
28 -s
29 Signed data (two’s complement)
30
31 -b
32 Byte swap the data during import
33
34 -h
35 Get region info from GMT style header
36
37 --overwrite
38 Allow output files to overwrite existing files
39
40 --help
41 Print usage summary
42
43 --verbose
44 Verbose module output
45
46 --quiet
47 Quiet module output
48
49 --ui
50 Force launching GUI dialog
51
52 Parameters:
53 input=name [required]
54 Name of binary raster file to be imported
55
56 output=name [required]
57 Output name or prefix if several bands are imported
58
59 title=phrase
60 Title for resultant raster map
61
62 bytes=integer
63 Number of bytes per cell
64 Options: 1, 2, 4, 8
65
66 header=integer
67 Header size in bytes
68 Default: 0
69
70 bands=integer
71 Number of bands in input file
72 Bands must be in band-sequential order
73 Default: 1
74
75 order=string
76 Output byte order
77 Options: big, little, native, swap
78 Default: native
79
80 north=float
81 Northern limit of geographic region (outer edge)
82
83 south=float
84 Southern limit of geographic region (outer edge)
85
86 east=float
87 Eastern limit of geographic region (outer edge)
88
89 west=float
90 Western limit of geographic region (outer edge)
91
92 rows=integer
93 Number of rows
94
95 cols=integer
96 Number of columns
97
98 anull=float
99 Set Value to NULL
100
101 flip=string[,string,...]
102 Flip input horizontal and/or vertical
103 Options: h, v
104 h: Flip input horizontal (East - West)
105 v: Flip input vertical (North - South)
106
108 r.in.bin allows the user to create a (binary) GRASS raster map layer
109 from a variety of binary raster data formats.
110
111 The -s flag is used for importing two’s-complement signed data.
112
113 The -h flag is used to read region information from a Generic Mapping
114 Tools (GMT) type binary header. It is compatible with GMT binary grid
115 types 1 and 2.
116
117 The north, south, east, and west field values are the coordinates of
118 the edges of the geographic region. The rows and cols values describe
119 the dimensions of the matrix of data to follow. If the input is a GMT
120 binary array (-h flag), the six dimension fields (north, south, east,
121 west, rows and cols) are obtained from the GMT header. If the bytes
122 field is entered incorrectly an error will be generated suggesting a
123 closer bytes value.
124
125 r.in.bin can be used to import numerous binary arrays including:
126 ETOPO30, ETOPO-5, ETOPO-2, Globe DEM, BIL, AVHRR and GMT binary arrays
127 (ID 1 & 2).
128
130 If optional parameters are not supplied, r.in.bin attempts to calculate
131 them. For example if the rows and columns parameters are not entered,
132 r.in.bin automatically calculates them by subtracting south from north
133 and west from east. This will only produce correct results if the
134 raster resolution equals 1. Also, if the north, south, east, and west
135 parameters are not entered, r.in.bin assigns them from the rows and
136 columns parameters. In the AVHRR example (see below), the raster would
137 be assigned a north=128, south=0, east=128, west=0.
138
139 The geographic coordinates north, south, east, and west describe the
140 outer edges of the geographic region. They run along the edges of the
141 cells at the edge of the geographic region and not through the center
142 of the cells at the edges.
143
144 Eastern limit of geographic region (in projected coordinates must be
145 east of the west parameter value, but in geographical coordinates will
146 wrap around the globe; user errors can be detected by comparing the
147 ewres and nsres values of the imported map layer carefully).
148 Western limit of geographic region (in projected coordinates must be
149 west of the east parameter value, but in geographical coordinates will
150 wrap around the globe; user errors can be detected by comparing the
151 ewres and nsres values of the imported map layer carefully).
152
153 Notes on (non)signed data:
154
155 If you use the -s flag, the highest bit is the sign bit. If this is 1,
156 the data is negative, and the data interval is half of the unsigned
157 (not exactly).
158
159 This flag is only used if bytes= 1. If bytes is greater than 1, the
160 flag is ignored.
161
163 GTOPO30 DEM
164 The following is a sample call of r.in.bin to import GTOPO30 DEM data:
165
166 r.in.bin -sb input=E020N90.DEM output=gtopo30 bytes=2 north=90 south=40
167 east=60 west=20 r=6000 c=4800
168
169 (you can add "anull=-9999" if you want sea level to have a NULL value)
170
171 GMT
172 The following is a sample call of r.in.bin to import a GMT type 1
173 (float) binary array:
174
175 r.in.bin -hf input=sample.grd output=sample.grass
176
177 (-b could be used to swap bytes if required)
178
179 AVHRR
180 The following is a sample call of r.in.bin to import an AVHRR image:
181
182 r.in.bin in=p07_b6.dat out=avhrr c=128 r=128
183
184 ETOPO2
185 The following is a sample call of r.in.bin to import ETOPO2 DEM data
186 (here full data set):
187
188 r.in.bin ETOPO2.dos.bin out=ETOPO2min r=5400 c=10800 n=90 s=-90 w=-180 e=180 bytes=2
189 r.colors ETOPO2min rules=terrain
190
191 TOPEX/SRTM30 PLUS
192 The following is a sample call of r.in.bin to import SRTM30 PLUS data:
193
194 r.in.bin -sb input=e020n40.Bathymetry.srtm output=e020n40_topex \
195 bytes=2 north=40 south=-10 east=60 west=20 r=6000 c=4800
196 r.colors e020n40_topex rules=etopo2
197
198 GPCP
199 The following is a sample call of r.in.bin to import GPCP 1DD v1.2
200 data:
201
202 YEAR="2000"
203 MONTH="01"
204 # number of days of this month
205 MDAYS=`date -d"${YEAR}-${MONTH}-01 + 1 month - 1 day" +%d`
206 r.in.bin in=gpcp_1dd_v1.2_p1d.${YEAR}${MONTH} out=gpcp_${YEAR}.${MONTH}. \
207 order=big bytes=4 -f header=1440 anull=-99999 \
208 n=90 s=-90 w=0 e=360 rows=180 cols=360 bands=$MDAYS
209
210 The following is a sample call of r.in.bin to import GPCP v2.2 data:
211
212 r.in.bin in=gpcp_v2.2_psg.1979 out=gpcp_1979. \
213 order=big bytes=4 -f header=576 anull=-99999 \
214 n=90 s=-90 w=0 e=360 rows=72 cols=144 bands=12
215
217 r.import, r.out.bin, r.in.ascii, r.out.ascii, r.in.gdal, r.out.gdal,
218 r.in.srtm
219
221 Jacques Bouchard, France (bouchard@onera.fr)
222 Bob Covill, Canada (bcovill@tekmap.ns.ca)
223 Markus Metz
224 Man page: Zsolt Felker (felker@c160.pki.matav.hu)
225
227 Available at: r.in.bin source code (history)
228
229 Main index | Raster index | Topics index | Keywords index | Graphical
230 index | Full index
231
232 © 2003-2019 GRASS Development Team, GRASS GIS 7.8.2 Reference Manual
233
234
235
236GRASS 7.8.2 r.in.bin(1)