Grid example

A file is georeferenced in UTM coordinates. As part of the final processing steps, the user wishes a grid to be superimposed on the imagery along 1000-meter intervals in both the x and y directions. The input imagery is an RGB-enhanced image on channels 1, 2, 3. The output will be to channels 7, 8, and 9.

 if (mod(@geox,1000)<=@sizex) or (mod(@geoy,1000)<=@sizey) then
     %7 = 255
     %8 = 255   
     %9 = 255
 else
     %7 = %1
     %8 = %2
     %9 = %3
 endif

The following model prompts the user for the spacing (in pixels) for a regular grid as well as for an input and output channel.

  local int spacing, in_chan, out_chan
  input "Enter the grid spacing:   " spacing
  input "Enter the input  channel: " in_chan
  input "Enter the output channel: " out_chan
  if (mod(@x,spacing)=0) or (mod(@y,spacing)=0) then
    %{out_chan} =255
  else
    %{out_chan} = %{in_chan}
  endif

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.