Raster Calculator

The Raster Calculator allows the user to perform Raster Calculations on remotely sensed imagery To initiate a Raster Calculation, go to the Analysis menu and select Raster Calculator - Apply Formula (NDVI, NDWI, etc) to Image/Grid Layer(s).

If more than one raster layer is loaded, the Select Layers window will appear. Check the raster layers to select the data for analysis.  

Click OK and the Set up Apply Formula Operation window will appear.

Layer Description

The layer(s) selected for Raster Calculation will show in Layer Description.


Under Formula, the user may choose to Add Predefined Formula, or Add Custom Formula.

Add Predefined Formula

The Add Predefined Formula allows the user to choose between different analyses built into the Raster Calculator.


The Normalized Difference Vegetation Index (NDVI) is a commonly used vegetation indices derived from the Near-Infrared (NIR) and RED channels of remotely sensed imagery. NDVI is an index of vegetation’s photosynthetic activity, or ‘greenness’. Vegetation indices are based on the observation that different surfaces reflect different types of light differently.

The NDVI is calculated by determining the ratio of red and near infrared bands from a remotely-sensed image on a per-pixel basis to use as the normalized difference between red and near infrared bands in an image.

There are a couple of predefined options for NDVI, depending on which band NIR and RED are found in.  

 NDVI (Landsat 8 OLI) : NIR=B5, Red=B4
 NDVI (Landsat 5 TM) : NIR=B4, Red=B3
 NDVI (Sentinel 2 MSI): NIR=B8, Red=B4


The Normalized Difference Water Index (NDWI) is derived from the Near-Infrared (NIR) and Green (G) channels. This formula highlights the amount of water in water bodies.

An alternate method of calculation uses the NIR and Short Wave Infrared (SWIR) channels [(NIR-SWIR)/(NIR+SWIR)]. The amount of water present in vegetation primarily affects the spectral reflectance in the SWIR channel. The information about vegetation contained in the SWIR channel is unique. NDWI should be considered as an independent vegetation index.

NDWI (Landsat 8 OLI): G=B3, NIR=B5
NDWI (Landsat 5 TM): G=B2, NIR=B4
NDWI (Sentinel 2 MSI): G=B3, NIR=B8


The Normalized Burn Ratio calculation is used to highlight burned areas and to estimate severity of fire. Burned areas reflect high in shortwave infrared (SWIR) and low in near infrared (NIR) and will therefore have a low NBR value. Similar to NDVI, healthy vegetation will have a high NBR value. The band numbers (B4, B6) are based on Landsat 4-5 band designations, but the formula may be used for any imagery by specifying the NIR band as B4 and the SWIR band as B6 in the subsequent dialog.

NBR [Normalized Burn Ratio]: NIR=B4, SWIR/Thermal=B6
NBRI (Landsat 8 OLI): NIR=B5, SWIR/Thermal=B7
NBRI (Landsat 5 TM): NIR=B4, SWIR/Thermal=B7
NBRI (Sentinel 2 MSI): NIR=B8, SWIR/Thermal=B12

NPCRI = (Red-Blue)/(Red+Blue)

The Normalized Pigment Chlorophyll Ratio Index (NPCRI) is a numerical indicator which can be used to determine crop and/or vegetation chlorophyll content. This formula is usually found within application in precession agriculture. For example, crops with low Nitrogen content can have a high carotenoid to chlorophyll ratio. Using the red and blue spectral bands, NPCRI captures the information needed to quantify chlorophyll and Nitrogen. This formula can also be used with red and blue spectral bands from various satellites.

NPCRI (Landsat 8 OLI) : Red=B4, Blue=B2
NPCRI (Landsat 5 TM) : Red=B3, Blue=B1
NPCRI (Sentinel 2 MSI) : Red=B4, Blue=B2

NDSI =(Green-SWIR) / (Green+SWIR)

The Normalized Difference Snow Index (NDSI) is a numerical indicator that shows snow cover over land areas. The green and short wave infrared (SWIR) spectral bands are used within this formula to map the snow cover. Since snow absorbs most of the incident radiation in the SWIR while clouds do not, this enables NDSI to distinguish snow from clouds. This formula is commonly used in snow/ice cover mapping application as well as glacier monitoring.

NDSI (Landsat 8 OLI) : Green=B3, SWIR=B6
NDSI (Landsat 5 TM) : Green=B2, SWIR=B5
NDSI (Sentinel 2 MSI) : Green=B3, SWIR=B11

NDGI = (NIR-Green)/(NIR+Green)

Normalized Difference Glacier Index (NDGI) is used to help detect and monitor glaciers by using the green and red spectral bands. This equation is commonly used in glacier detection and glacier monitoring applications.

NDGI (Landsat 8 OLI) : NIR=B3, Green=B4
NDGI (Landsat 5 TM) : NIR=B2, Green=B3
NDGI (Sentinel 2 MSI) : NIR=B3, Green=B4


The Normalized Difference Moisture Index (NDMI) that is used in combination with other vegitation indexes (NDVI and/or ADVI) associated with vegetation moisture. This formula uses the near infrared (NIR) and short wave infrared (SWIR) to capture the variations of moisture in vegetated areas. NDMI is applicable in applications looking at drought monitoring and subtle changes in vegetation moisture conditions. NDMI can also be used to determine fuel moistures for wildfire hazard assessments.

NDMI (Landsat 8 OLI) : NIR=B5, SWIR=B6
NDMI (Landsat 5 TM) : NIR=B4, SWIR=B5
NDMI (Sentinel 2 MSI) : NIR=B8, SWIR=B11

AVI = [NIR * (1-Red) * (NIR-Red)] 1/3

Advanced Vegetation Index (AVI) is similar to NDVI which uses the red and near-infrared spectral bands to monitor crop and forest variations over time. With the multi-temporal combination of the AVI and the NDVI allows for the discrimination of different types of vegetation and extract phenology characteristics.

AVI (Landsat 8 OLI) : NIR= B5, Red=B4
AVI (Landsat 5 TM) : NIR=B4, Red=B3
AVI (Sentinel 2 MSI) : NIR=B8, Red=B4

BSI = ((Red+SWIR) - (NIR+Blue)) / ((Red+SWIR) + (NIR+Blue))

The Bare Soil Index (BSI) combines blue, red, near infrared (NIR), and short wave infrared (SWIR) bands to capture soil variations. These bands are used in a normalized manner, with the SWIR and red bands being used to quantify the soil mineral composition, while the blue and NIR bands are used to enhance the presence of vegetation. This numerical indicator can be used for soil mapping and crop identification.

BSI (Landsat 8 OLI) : Red= B6, SWIR=B4, NIR=B5, Blue=B2
BSI (Landsat 5 TM) : Red=B5, SWIR=B3, NIR=B4, Blue=B1
BSI (Sentinel 2 MSI) : Red=B11, SWIR=B4, NIR=B8, Blue=B2

SI = [(1-Red)*(1-Green)*(1-Blue)]1/3

Canopy Shadow provides essential information about tree and plant arrangements. The characteristics of canopy shadow are associated by the total spectral radiance that is reflected from the canopy. Shadow Index (SI) is calculated using the red, blue, and green bands in a way that simulates the amount of energy not reflected back to the sensor. The main application for this is in forestry and crop monitoring, and can be combined with AVI and BSI to understand vegetation status.

SI (Landsat 8 OLI) : Red=B2, Green=B3, Blue=B4
SI (Landsat 5 TM) : Red=B1, Green=B2, Blue=B3
SI (Sentinel 2 MSI) : Red=B2, Green=B3, Blue=B4

Add Custom Formula

The Add Custom Formula allows the user to input the raster or 'band math' for custom calculations. Bands should be specified as B1 for Band 1, B2 for Band 2, and so forth. See Custom Formula Reference

Add Band

When the Add Band button is clicked, the band selection dialog will ask which specific bands from the loaded layers correspond to the bands in the formula(s).

Set up Output Grid Settings

Set up Output Grid Settings allows the user to specify the bit depth of a shaded single band grid of the new band, or to create a Multi-Band image as output. The Shader option can be used to specify that a predefined or custom Shader should be applied to the image, rather than the default NDVI shader.

Using Elevation Data

Use 'Z' in the equations for the elevation when providing a formula for terrain layers (B1 will also work). The selected input layers must be either all elevation or all raster imagery and the appropriate mode (i.e. from grids or from imagery).

If all inputs are grids then the output can only be a single band/ formula targeting a grid format.

Custom Formula Reference

Custom Formulas allow you to generate new bands for a raster image based on formulas that are not already predefined in Global Mapper. Formulas are mathematical expressions that can combine numbers, band values, or elevations to compute new band values. They may use standard mathematical operators like +, -, *, /, ^ (power), comparison and relational operators, and functions like LOG, LOG10, MIN, and MAX to produce new values.



Formulas use various mathematical and logical operators to form a result, similar to spreadsheet formulas. They are (in order of precedence, low-to-high):

You may also use parentheses to specify order of operations. In the absence of parentheses, higher precedence operations are performed before lower precedence operations. That is, in the formula "B1 + r * 3", the result is the value of 'B1' plus the product of 'r' and '3' (equivalently "B1 + (r * 3)").


The calculator provides several built-in functions to aid in calculation of values. Note that function names are case-insensitive; that is, log is the same as LOG