Map and Table Calculation

Simple calculators

The command line in the Main window and the command line of a table window can be used as a pocket line calculator. The pocket line calculator is an ILWIS tool which enables the user to make quick calculations. All operators and functions described in Map and Table Calculation are available.

To use the pocket line calculator type on the command line of the Main window, or on the command line of a table window, a ? followed by your calculation/expression.

The pocket line calculator is especially convenient for:

Furthermore, all operators and functions that are available for Map and Table calculation can also be used:

Tip:

The Map and Table calculation operators and functions can of course also be used in user-defined functions and scripts.

Examples:

Pocket line calculator examples

? 7 + 8

returns 15

? 10 DIV 3

returns the integer quotient, i.e. 3

? SIN(PI/2)

returns the sine of PI/2, i.e. 1.0

? COS(DEGRAD(60))

returns the cosine of 60 degrees, i.e. 0.50

? MAPCOLOR (DEM,150,200)

retrieves the color of map DEM at row 150 and column 200, e.g. (255, 89, 16)

? MAPVALUE(Tmb1,COORD(800000,8080000))

returns the value of Tmb1 on the location with X-coordinate 800000 and Y-coordinate 8080000, e.g. 50.

? IFF(MAPVALUE(DEM,(COORD(100000,100000))>2500,"High","Low")

returns "High" if the value of the DEM on the specified location is higher than 2500; when the altitude is less than 2500, "Low" is returned.

User-defined functions in pocket line calculator:

More complicated expressions or expressions which will be used several times may be stored as a user-defined function or in an ASCII-file. ASCII-files can be made in any text editor. Application of such a file requires ?@FileName on the command line. The user-defined function Suitable may look like:

IFF ((MAPVALUE(Soil,COORD(150000,200000))="Rock") OR (MAPVALUE(Slope,COORD(150000,200000))>30),"Unsuitable","Suitable")

To apply this file, type:

?@Suitable

Tip:

For more information on user-defined functions, refer to Map and Table Calculation : User-defined functions.

See also: