Raster Calculator

The Raster Calculator allows the user to perform Raster Calculations on remotely sensed imagery.

To initiate a Raster Calculation, go to the Raster 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.

Formula

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.

NDVI = (NIR-RED)/(NIR+RED)

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 (RGBI): NIR = B4, RED=B1
NDVI (IBGR): NIR=B1, RED= B4
 NDVI (Landsat 8 OLI) : NIR=B5, Red=B4
 NDVI (Landsat 5 TM) : NIR=B4, Red=B3
 NDVI (Sentinel 2 MSI): NIR=B8, Red=B4

NDWI = (G-NIR)/(G+NIR)

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 : G=B2, NIR=B4
NDWI (IBGR):  G= B3, NIR=B1
NDWI (RGBI): G=B2, NIR=B4
NDWI (Landsat 8 OLI): G=B3, NIR=B5
NDWI (Landsat 5 TM): G=B2, NIR=B4
NDWI (Sentinel 2 MSI): G=B3, NIR=B8

NBR = (NIR-SWIR)/(NIR+SWIR)

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 precision 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)

The 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

NDMI = (NIR - SWIR) / (NIR+SWIR)

The Normalized Difference Moisture Index (NDMI) that is used in combination with other vegetation 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.

Operands

  • Numbers - Here are some examples of numbers:
    • 3.14159
    • 42
    • 1234e-3 (scientific notation; the result is 1.234)
    • 123,456 (European notation; the result is 123.456)
  • Band values - Band values refer to a specific raster band in an image. Allowable band references (again, the names below are case-insensitive):

    • red or R: Red band
    • green or G: Green band
    • blue or B: Blue band
    • B#, where # is an integer greater than zero: a numbered band, e.g., B3
    • elev or Z: Elevation pseudo-band for use with terrain layers (in which case, B1 is equivalent)

Operators

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

  • OR : logical OR: both operands are treated as boolean values and a boolean value is returned (1 if either of the operands are non-zero, or 0 otherwise).
  • AND : logical AND: both operands are treated as boolean values, and a boolean value is returned (1 if both of the operands are non-zero, or 0 otherwise).
  • ==, <>, ~= : comparison operators: equals, not equals, and case-insensitive string comparison, respectively.
  • <, <=, >, >= : relational operators: less than, less than or equal to, greater than, and greater than or equal to, respectively.
  • +, - : additive operators: plus and minus, respectively.
  • *, / : multiplicative operators: times and divide, respectively. The operands are assumed to be numeric.
  • ^ : exponentiation
  • +, -, NOT : unary operators: plus, minus, and logical NOT respectively. The operands for unary plus and minus are assumed to be numeric; the operand for unary NOT is assumed to be boolean.

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)").

Functions

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

  • LOG( expression ) : Natural logarithm. The expression parameter is assumed to be a numeric value.
  • LOG10( expression ) : Base 10 logarithm. The expression parameter is assumed to be a numeric value.
  • MAX( expression1, expression2 ) : Maximum value of a expression1 and expression2.
  • MIN( expression1, expression2 ) : Minimum value of a expression1 and expression2.
  • IF( expression, expression2, expression3 ) : Evaluate expression, and if it is true, return expression2; otherwise return expression3
  • SIN( expression ) : Return the sine of an expression, assumed to be expressed in radians.
  • COS( expression ) : Return the cosine of an expression, assumed to be expressed in radians.
  • TAN( expression ) : Return the tangent of an expression, assumed to be expressed in radians.
  • SIN_DEG( expression ) : Return the sine of an expression, assumed to be expressed in degrees.
  • COS_DEG( expression ) : Return the cosine of an expression, assumed to be expressed in degrees.
  • TAN_DEG( expression ) : Return the tangent of an expression, assumed to be expressed in degrees.
  • ASIN( expression ) : Return the arc sine (inverse sine) of an expression, assumed to be expressed in radians.
  • ACOS( expression ) : Return the arc cosine (inverse cosine) of an expression, assumed to be expressed in radians.
  • ATAN( expression ) : Return the arc tangent (inverse tangent) of an expression, assumed to be expressed in radians.
  • SQRT( expression ) : Square root. The expression parameter is assumed to be a numeric value greater or equal to 0.
  • CUBERT( expression ) : Cube root. The expression parameter is a numeric value, and the result will have the same sign as the expression. For example, cubert( 8 ) = 2, and cubert( -8 ) = -2. Note that cubert( n ) is equivalent to pow( n, 1/3 ).
  • AND( expression list ) : Return true (1) if all of the comma-separated list of expressions are non-zero, otherwise return false (0).
  • OR( expression list ) : Return true (1) if any of the comma-separated list of expressions are non-zero, otherwise return false (0).
  • CLAMP( expression1, expression2, expression3 ) : Evaluate expression1, and if it is less than expression2, return expression2, else if it is larger than expression3, return expression3; otherwise return expression1
  • INRANGE( expression1, expression2, expression3 ) : Evaluate expression1, and if it is less than expression2 or larger than expression3, return false (0); otherwise return true (1)
  •  

Statistics Functions - These are functions that return statistics for a particular named band. For example, to scale the B1 band to a range of 0 - 1, you could use the formula: (B1 - @MIN( B1 )) / (@MAX( B1 ) - @MIN( B1 ))

  • @MIN( band ) : Returns minimum value for the given input band.
  • @MAX( band ) : Returns maximum value for the given input band.
  • @MEAN( band ) : Returns arithmetic mean value for the given input band.
  • @AVG( band ) : Returns average value for the given input band.
  • @STDDEV( band ) : Returns standard deviation for the given input band.

Tiling Panel

Export Bounds