@@ -53,36 +53,36 @@ FORCE comes with a program to generate processing masks from vector data (e.g. s
53
53
54
54
force-cube -h
55
55
56
- Usage: force-cube [-hvirsantobj] input-file(s)
57
-
58
- optional:
59
- -h = show this help
60
- -v = show version
61
- -i = show program' s purpose
62
- -r = resampling method
63
- any GDAL resampling method for raster data, e.g. cubic (default)
64
- is ignored for vector data
65
- -s = pixel resolution of cubed data, defaults to 10
66
- -a = optional attribute name for vector data. force-cube will burn these values
67
- into the output raster. default: no attribute is used; a binary mask
68
- with geometry presence (1) or absence (0) is generated
69
- -l = layer name for vector data (default: basename of input, without extension)
70
- -n = output nodate value (defaults to 255)
71
- -t = output data type (defaults to Byte; see GDAL for datatypes;
72
- but note that FORCE HLPS only understands Int16 and Byte types correctly)
73
- -o = output directory: the directory where you want to store the cubes
74
- defaults to current directory
75
- ' datacube-definition.prj' needs to exist in there
76
- -b = basename of output file (without extension)
77
- defaults to the basename of the input-file
78
- cannot be used when multiple input files are given
79
- -j = number of jobs, defaults to ' as many as possible'
80
-
81
- mandatory:
82
- input-file(s) = the file(s) you want to cube
83
-
84
- -----
85
- see https://force-eo.readthedocs.io/en/latest/components/auxilliary/cube.html
56
+ $ Usage: force-cube [-hvirsantobj] input-file(s)
57
+ $
58
+ $ optional:
59
+ $ -h = show this help
60
+ $ -v = show version
61
+ $ -i = show program' s purpose
62
+ $ -r = resampling method
63
+ $ any GDAL resampling method for raster data, e.g. cubic (default)
64
+ $ is ignored for vector data
65
+ $ -s = pixel resolution of cubed data, defaults to 10
66
+ $ -a = optional attribute name for vector data. force-cube will burn these values
67
+ $ into the output raster. default: no attribute is used; a binary mask
68
+ $ with geometry presence (1) or absence (0) is generated
69
+ $ -l = layer name for vector data (default: basename of input, without extension)
70
+ $ -n = output nodate value (defaults to 255)
71
+ $ -t = output data type (defaults to Byte; see GDAL for datatypes;
72
+ $ but note that FORCE HLPS only understands Int16 and Byte types correctly)
73
+ $ -o = output directory: the directory where you want to store the cubes
74
+ $ defaults to current directory
75
+ $ ' datacube-definition.prj' needs to exist in there
76
+ $ -b = basename of output file (without extension)
77
+ $ defaults to the basename of the input-file
78
+ $ cannot be used when multiple input files are given
79
+ $ -j = number of jobs, defaults to ' as many as possible'
80
+ $
81
+ $ mandatory:
82
+ $ input-file(s) = the file(s) you want to cube
83
+ $
84
+ $ -----
85
+ $ see https://force-eo.readthedocs.io/en/latest/components/auxilliary/cube.html
86
86
87
87
88
88
@@ -100,10 +100,10 @@ In the following example, we generate a processing mask for the administrative a
100
100
101
101
force-cube -o /data/europe/mask vienna.shp
102
102
103
- 0...10...20...30...40...50...60...70...80...90...100 - done.
104
- 0...10...20...30...40...50...60...70...80...90...100 - done.
105
- 0...10...20...30...40...50...60...70...80...90...100 - done.
106
- 0...10...20...30...40...50...60...70...80...90...100 - done.
103
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
104
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
105
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
106
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
107
107
108
108
109
109
In this example, Vienna is covered by four tiles, a cubed GeoTiff was generated in each tile:
@@ -112,10 +112,10 @@ In this example, Vienna is covered by four tiles, a cubed GeoTiff was generated
112
112
113
113
ls /data/europe/mask/X*/vienna.tif
114
114
115
- /data/europe/mask/X0077_Y0058/vienna.tif
116
- /data/europe/mask/X0077_Y0059/vienna.tif
117
- /data/europe/mask/X0078_Y0058/vienna.tif
118
- /data/europe/mask/X0078_Y0059/vienna.tif
115
+ $ /data/europe/mask/X0077_Y0058/vienna.tif
116
+ $ /data/europe/mask/X0077_Y0059/vienna.tif
117
+ $ /data/europe/mask/X0078_Y0058/vienna.tif
118
+ $ /data/europe/mask/X0078_Y0059/vienna.tif
119
119
120
120
121
121
For speedy visuailzation, build overviews and pyramids:
@@ -125,17 +125,17 @@ For speedy visuailzation, build overviews and pyramids:
125
125
force-pyramid /data/europe/mask/X*/*.tif
126
126
force-mosaic /data/europe/mask
127
127
128
- computing pyramids for vienna.tif
129
- 0...10...20...30...40...50...60...70...80...90...100 - done.
130
- computing pyramids for vienna.tif
131
- 0...10...20...30...40...50...60...70...80...90...100 - done.
132
- computing pyramids for vienna.tif
133
- 0...10...20...30...40...50...60...70...80...90...100 - done.
134
- computing pyramids for vienna.tif
135
- 0...10...20...30...40...50...60...70...80...90...100 - done.
136
-
137
- mosaicking vienna.tif
138
- 4 chips found.
128
+ $ computing pyramids for vienna.tif
129
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
130
+ $ computing pyramids for vienna.tif
131
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
132
+ $ computing pyramids for vienna.tif
133
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
134
+ $ computing pyramids for vienna.tif
135
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
136
+ $
137
+ $ mosaicking vienna.tif
138
+ $ 4 chips found.
139
139
140
140
141
141
.. figure:: img/tutorial-mask-vector.jpg
@@ -152,31 +152,31 @@ FORCE comes with a program to generate processing masks from a raster image with
152
152
153
153
force-procmask -h
154
154
155
- Usage: force-procmask [-sldobj] input-basename calc-expr
156
-
157
- optional:
158
- -s = pixel resolution of cubed data, defaults to 10
159
- -l = input-layer: band number in case of multi-band input rasters,
160
- defaults to 1
161
- -d = input directory: the datacube directory
162
- defaults to current directory
163
- ' datacube-definition.prj' needs to exist in there
164
- -o = output directory: the directory where you want to store the cubes
165
- defaults to current directory
166
- -b = basename of output file (without extension)
167
- defaults to the basename of the input-file,
168
- appended by ' _procmask'
169
- -j = number of jobs, defaults to ' as many as possible'
170
-
171
- Positional arguments:
172
- - input-basename: basename of input data
173
- - calc-expr: Calculation in gdalnumeric syntax, e.g. ' A> 2500' "
174
- The input variable is ' A'
175
- For details about GDAL expressions, see
176
- https://gdal.org/programs/gdal_calc.html
177
-
178
- -----
179
- see https://force-eo.readthedocs.io/en/latest/components/auxilliary/procmask.html
155
+ $ Usage: force-procmask [-sldobj] input-basename calc-expr
156
+ $
157
+ $ optional:
158
+ $ -s = pixel resolution of cubed data, defaults to 10
159
+ $ -l = input-layer: band number in case of multi-band input rasters,
160
+ $ defaults to 1
161
+ $ -d = input directory: the datacube directory
162
+ $ defaults to current directory
163
+ $ ' datacube-definition.prj' needs to exist in there
164
+ $ -o = output directory: the directory where you want to store the cubes
165
+ $ defaults to current directory
166
+ $ -b = basename of output file (without extension)
167
+ $ defaults to the basename of the input-file,
168
+ $ appended by ' _procmask'
169
+ $ -j = number of jobs, defaults to ' as many as possible'
170
+ $
171
+ $ Positional arguments:
172
+ $ - input-basename: basename of input data
173
+ $ - calc-expr: Calculation in gdalnumeric syntax, e.g. ' A> 2500' "
174
+ $ The input variable is ' A'
175
+ $ For details about GDAL expressions, see
176
+ $ https://gdal.org/programs/gdal_calc.html
177
+ $
178
+ $ -----
179
+ $ see https://force-eo.readthedocs.io/en/latest/components/auxilliary/procmask.html
180
180
181
181
182
182
In the example given below, our input image is a multiband continuous fields dataset,
@@ -193,16 +193,16 @@ In our case, the data are already in datacube format, covering 597 tiles:
193
193
cd /data/europe/pred
194
194
ls X* /* .tif | head
195
195
196
- X0052_Y0045/CONFIELD_MLP.tif
197
- X0052_Y0046/CONFIELD_MLP.tif
198
- X0052_Y0047/CONFIELD_MLP.tif
199
- X0052_Y0048/CONFIELD_MLP.tif
200
- X0052_Y0049/CONFIELD_MLP.tif
201
- X0052_Y0050/CONFIELD_MLP.tif
202
- X0052_Y0051/CONFIELD_MLP.tif
203
- X0052_Y0052/CONFIELD_MLP.tif
204
- X0052_Y0053/CONFIELD_MLP.tif
205
- X0053_Y0045/CONFIELD_MLP.tif
196
+ $ X0052_Y0045/CONFIELD_MLP.tif
197
+ $ X0052_Y0046/CONFIELD_MLP.tif
198
+ $ X0052_Y0047/CONFIELD_MLP.tif
199
+ $ X0052_Y0048/CONFIELD_MLP.tif
200
+ $ X0052_Y0049/CONFIELD_MLP.tif
201
+ $ X0052_Y0050/CONFIELD_MLP.tif
202
+ $ X0052_Y0051/CONFIELD_MLP.tif
203
+ $ X0052_Y0052/CONFIELD_MLP.tif
204
+ $ X0052_Y0053/CONFIELD_MLP.tif
205
+ $ X0053_Y0045/CONFIELD_MLP.tif
206
206
207
207
208
208
We generate the masks using ``force-procmask ``, which internally uses ``gdal_calc.py `` for executing the raster algebra.
@@ -225,11 +225,11 @@ To generate a mask with tree cover > 30%, we use the following:
225
225
' A>3000'
226
226
227
227
228
- Computers / CPU cores / Max jobs to run
229
- 1:local / 80 / 597
230
-
231
- Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete
232
- ETA: 0s Left: 0 AVG: 0.00s local:0/597/100%/0.1s
228
+ $ Computers / CPU cores / Max jobs to run
229
+ $ 1:local / 80 / 597
230
+ $
231
+ $ Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete
232
+ $ ETA: 0s Left: 0 AVG: 0.00s local:0/597/100%/0.1s
233
233
234
234
235
235
We now have one cubed mask for each input image in the mask directory:
@@ -238,7 +238,7 @@ We now have one cubed mask for each input image in the mask directory:
238
238
239
239
ls /data/europe/mask/X* /forest-mask.tif | wc -l
240
240
241
- 597
241
+ $ 597
242
242
243
243
244
244
For speedy visuailzation, build overviews and pyramids:
@@ -248,18 +248,18 @@ For speedy visuailzation, build overviews and pyramids:
248
248
force-pyramid /data/europe/mask/X* /forest-mask.tif
249
249
force-mosaic /data/europe/mask
250
250
251
- computing pyramids for forest-mask.tif
252
- 0...10...20...30...40...50...60...70...80...90...100 - done.
253
- computing pyramids for forest-mask.tif
254
- 0...10...20...30...40...50...60...70...80...90...100 - done.
255
- computing pyramids for forest-mask.tif
256
- 0...10...20...30...40...50...60...70...80...90...100 - done.
257
- computing pyramids for forest-mask.tif
258
- 0...10...20...30...40...50...60...70...80...90...100 - done.
259
- ...
260
-
261
- mosaicking forest-mask.tif
262
- 597 chips found.
251
+ $ computing pyramids for forest-mask.tif
252
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
253
+ $ computing pyramids for forest-mask.tif
254
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
255
+ $ computing pyramids for forest-mask.tif
256
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
257
+ $ computing pyramids for forest-mask.tif
258
+ $ 0...10...20...30...40...50...60...70...80...90...100 - done.
259
+ $ ...
260
+ $
261
+ $ mosaicking forest-mask.tif
262
+ $ 597 chips found.
263
263
264
264
265
265
.. figure :: img/tutorial-mask-raster.jpg
0 commit comments