Binary logical raster operation is used to generate boolean maps based on logical and relational operators. The operation includes operators such as: and, or, xor(exclusive or), less, lesseq(equal or less than), neq (not equal), eq (equal), greater and greatereq(equal or greater than). One of the input map for this operation has to be a boolean map or a number. The output map is a Boolean map with value 1 (True) and 0 (False) illustrating whether the condition is met or not, respectively.
The Binary logical raster operation can be applied via ILWIS-Python editor or via ILWIS Main window, Toolbar and the Operatins tab. The required Python syntax is:
name of the output raster coverage = ilwis.Engine.do(name of the operation, name of input raster coverage or number, name of input raster coverage or number, Operator)
Then, the Python syntax for the above mentioned operation is:
output raster = ilwis.Engine.do("binarylogicalraster", “file:///C:/my director/my raster coverage/number", “file:///C:/my director/my raster coverage/number", "Operator")
Note that, one of the input has to be a number or a Boolean map.
In general, the URL used in the Python syntax can be replaced with variable name created using Python. For example: you can open a feature coverage and a georeference as variables and give them a name as the following example:
rc = ilwis.RasterCoverage("file:///C:/my director/ myfile.mpr")
rcb = ilwis.RasterCoverage("file:///C:/my director/ myfile-boolean.mpr")
Note that, this file is a Boolean map.
Once these variable is created via ILWIS-Python editor, then they can be used directly in Python syntax without quotation mark and the path as the following:
output = ilwis.Engine.do("binarylogicalraster", rc, "rcb" "greater")