Map and Table Calculation

Calculating with map lists

Map Calculation:

To apply a MapCalc formula on all raster maps in a map list, you can type a map list expression on the command line of the Main window. For instance, if the regular MapCalc formula on InMap reads:

 

OutMap = SQ(InMap) + 10

 

Then, the map list expression to use the formula on all input maps in a map list InMapList reads:

 

OutMapList = MapListApplic(InMapList, "SQ(##) + 10")

 

where ## represents the individual raster maps in the map list.

The output map list is a dependent object. When the output map list is opened, the dependent output raster maps will be defined and calculated. The output raster maps of the map list will obtain the same name as the output map list, followed by _1, _2, _3, etc. For more information, refer to ILWIS objects : Map lists.

Operations:

Similarly, operations that use a raster map as input and produce a raster map as output, can also be performed on all raster maps of an input map list. You can choose the input map list in the dialog box of the operation but you can also type an expression on the command line of the Main window. The general syntax of map list expressions for operations is:

 

OutMapList = MapListApplic(InMapList, MapOperation(##, other parameters))

 

where ## represents the individual raster maps in the map list.

The output map list is a dependent object. When the output map list is opened, the dependent output raster maps will be defined and calculated. The output raster maps of the map list will obtain the same name as the output map list, followed by _1, _2, _3, etc. For more information refer to Aggregate Map : command line (2), Filter : command line (2), Stretch : command line (2), Densify : command line (2), Resample : command line (2), Sub-Map of raster map : command line (2), or Mirror/Rotate : command line (2).

 

Map lists from General Raster Import:

In case the map list is the result of Import General Raster using the option Use Data in Original Format and without the creation of separate maps, then the object definition file will only contain a reference to the original non-ILWIS file and there will be no separate ILWIS raster maps stored on disk. When such a map list is opened, the first band is called 'band 1', the second 'band 2', etc.

On the command line, the first band of such a map list can be addressed as maplistname.mpl:1, the second band as maplistname.mpl:2, etc. To calculate with such maps on the command line, you can use for instance expressions like:

 

OUT = MyMapList:1 + MyMapList:2

 

OUT = 'My Map List'.mpl:1 + 'My Map List'.mpl:2.

 

See also: