<div dir="ltr">
<p>Dear all,</p><p>I work ith QGIS 3.40.
Using Landsat 5 satellite, I need to calculate several indices (vegetation, water, etc.), including the NDVI.</p>
<p>This isn't difficult, but since it's a time series, I have hundreds
of images from which I want to generate these same indices. Until now,
I've been generating these indices using the raster calculator in batch
mode. However, this isn't optimized because I still have to manually
edit/adapt the input filename for each NDVI expression/formula.</p>
<p>Regarding the 'input layers' parameter, it's not too complicated
since I've stored all my Landsat images in the same location/folder. For
your information, these are multi-band Landsat image files in GeoTIFF
format (one TIFF file consists of 8 bands).
Regarding the input layers, I select them by selecting all the files in
the input folder.</p>
<p>The complexity is greater with the expression parameter.</p>
<p>Here's an example of NDVI for an image:</p><p><br></p><p>
</p><pre><code>(("LT05_L2SP_197029_19920101_20200915_02_T1_SR_MERGE_CLIP_BBOX@4" * 0.0000275 - 0.2)
-
("LT05_L2SP_197029_19920101_20200915_02_T1_SR_MERGE_CLIP_BBOX@3" * 0.0000275 - 0.2))
/
(("LT05_L2SP_197029_19920101_20200915_02_T1_SR_MERGE_CLIP_BBOX@4" * 0.0000275 - 0.2)
+
("LT05_L2SP_197029_19920101_20200915_02_T1_SR_MERGE_CLIP_BBOX@3" * 0.0000275 - 0.2))<br><br></code></pre>
<p>
where "LT05_L2SP_197029_19920101_20200915_02_T1_SR_MERGE_CLIP_BBOX" is
the part that is supposed to vary from one image/iteration to another.
The rest is always the same (invariable/fixed). This includes the band
number (@3 or @4). How can I ensure that the variable part of the input
name is defined/determined based on the value set in the first
parameter, 'input layers'?
Finally, for the last parameter, 'calculated', the idea would be to
define it by the concatenation of a fixed path part + the variable
filename, which would be defined by 'variable input layer name' +
''_ndvi'. </p><p><br></p><img src="cid:ii_mktvvd300" alt="image.png" width="1252" height="136" style="margin-right: 25px;"><br><p><br></p><p><br></p><p>Thanks so much for your help.</p>
<br></div>