Selective selection of file names
I have several satellite scenes archived by folder with the different bands in Tif format. All the bands share a common name + _band1.tif, _band2.tif ... How can I only import band 2 and band 4 of the different scenes within a loop? I'm trying this, but I can not find where to add the band2 string to the name DIR_LOOP_START DIRECTORY="F:\...\Escenas" RECURSE_DIR=YES IMPORT FILENAME="%DIR%%FNAME+"band2"%" TYPE=GEOTIFF RASTER_TYPE="IMAGE" Thanks in advance
Tagged:
Answers
-
I was able to make the selection using FILENAME_MASK parameter:
DIR_LOOP_START DIRECTORY="%ESCENAS%" RECURSE_DIR=YES FILENAME_MASKS="*band2.tif *band4.tif"
Now I'm trying to apply the NDWI formula to the pair of loaded layers:IMPORT FILENAME="%FNAME_W_DIR%" TYPE=GEOTIFF RASTER_TYPE="IMAGE"
DEFINE_VAR NAME="B2" VALUE="%DIR%*band2.tif"DEFINE_VAR NAME="B4" VALUE="%DIR%*band4.tif"
APPLY_FORMULA FILENAME="%B2%" FILENAME="%B4%" OUTPUT_BIT_DEPTH="32" FORMULA="(%B2%-%B4%)/(%B2%+%B4%)" OUTPUT_GRID=YESEXPORT_ELEVATION FILENAME="%OUTPUT_DIR%%FNAME_WO_EXT%_ndwi.tif" TYPE=GEOTIFF COMPRESSION=NONE\POLYGON_CROP_FILE="%AOI%"
The part of applying the formula is not working.
Any ideas?
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website