NDVI Scripting

in Raster Data
I've been tasked with running NDVI calculations on 1500-odd 4 band orthophotos, and I'm having a hard time figuring out the script in Global Mapper to do so.
my script works, however, the results are wrong. What am i missing? Here's the script I'm using.
The attached image shows 1) The Original Image. 2) Manual NDVI Processing via the raster calculator in GM. 3) The third pane shows the results I'm getting via the script.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
my script works, however, the results are wrong. What am i missing? Here's the script I'm using.
The attached image shows 1) The Original Image. 2) Manual NDVI Processing via the raster calculator in GM. 3) The third pane shows the results I'm getting via the script.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
// Loop over all .tif files in a folder and convert them
DIR_LOOP_START DIRECTORY="E:\GM_Scripting_Test\" FILENAME_MASKS="*.tif" RECURSE_DIR=NO
// Import
IMPORT FILENAME="%FNAME_W_DIR%"
//Calculate NDVI
APPLY_FORMULA FILENAME="*" FORMULA="NDVI" OUTPUT_GRID=YES
//Export Raster
EXPORT_ELEVATION FILENAME="%DIR%%FNAME_WO_EXT%_ndvi.tif" TYPE=GEOTIFF
UNLOAD_ALL
// End the loop
DIR_LOOP_END
Tagged:
Answers
-
Hello,
First, I recommend getting the latest release of your version of Global Mapper. Make sure that your APPLY_FORMULA command is set up the same way as the Raster Calculator was. You are accepting a lot of default values, so it might be a good idea to make the parameter values explicit.
Cheers,
Bob
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 639 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 417 Projection Questions
- 829 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 179 Announcement and News
- 922 Bug Report
- 559 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 573 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 241 How I use Global Mapper
- 108 Global Mapper Forum Website