Map calculation

Algorithm

Your map calculation formula is processed in the following simplified way:

  

  1. Tokenizer:
  2.   

  3. Parser:
  4.   

  5. Code generator:
  6.   

  7. Calculator:
  8. For effiency reasons, the process is done line by line. This has the same result as when the instructions were carried out pixel by pixel.

Example 1:

OUTMAP = a+1

  

Stack contains following instructions:

load a

const 1

operator add

store

Example 2:

OUTMAP = (a+1) * (b+2)

  

Stack contains following instructions:

load a

const 1

operator add

load b

const 2

operator add

operator multiply

store

Example 3:

OUTMAP = iff(landuse="arable") and (slope<=20), "suitable", "not suitable")

  

Stack contains following instructions:

load landuse

const "arable"

equal

load slope

const 20

less than or equal

and

const "suitable"

const "not suitable"

call iff

store

See also: