Map and Table Calculation

Predefined variable %C

Variable to calculate with column numbers of raster maps.

Syntax

%C

Note:

C stands for Column number.

Usable in

MapCalc

Examples

MapCalc examples:

SubMap = IFF(INRANGE(%C,100,400) AND (INRANGE(%L,200,500)), InMap, "?")

 

InMap

  

SubMap

  

SubMap has the same content as InMap if the column number is in the range of 100 to 400 and the line number in the range of 200 to 500. Outside this area SubMap is undefined.

Applied example: Assigning pixels to a back drop line:

The next example describes the assignment of average values to pixels of an image in which whole lines are missing. Occasionally satellite images suffer from so called back drop lines. In this example every 8th line is missing. These lines are assigned values which are the average values from the line above and the line below.

OutImage = IFF((%L MOD 8=0), (RASVALUE(Image, %L-1, %C) + RASVALUE(Image, %L+1, %C))/2, Image)

Image

OutImage

Line 7

 

 

Line 8

 

 

Line 9
51 6 29
? ? ?
8 18 53
51.00 6.00 29.00
29.50 12.00 41.00
8.00 18.00 53.00

Image shows some pixels of line 7 up to line 9 while line 8 is missing. These missing values are replaced by the average values of the pixels of the line above and the line below.

Note:

In this example both maps use system domain Value.

See also: