![]() ![]() How variables and layers appear in the expression For more information regarding the syntax, what types of variables can be used, and the connectivity behavior of the Raster Calculator tool in ModelBuilder, see the Raster Calculator tool help. When using the Raster Calculator tool in ModelBuilder, the only difference is that variables can be used as input as well as layers. Con("inRas" = 45) & ("inRas" = 47)&("inRas" = 49,4))))Īn example Raster Calculator expression in ModelBuilder.In these expressions, the raster layer names are contained within quotes, for example, "dist". Raster Calculator tool dialog box examplesįollowing are several examples of map algebra expressions that can be run in the Raster Calculator tool. Similarly, only on the tool dialog box can Raster Calculator variables be contained within percent signs ( %) or quotation marks ( ").When working in Python itself, layers must first be cast as Raster objects. ![]() Only on the Raster Calculator tool dialog box can layer names be used directly with operators.Since there is a specific output parameter on the Raster Calculator tool dialog box, map algebra expressions do not include an output name and an equals sign ( =) when using the Raster Calculator tool. ![]() While map algebra is used both in the Raster Calculator tool and directly in Python, the following are differences in the syntax that you should be aware of: Example expressions for the Raster Calculator tool For more information, refer to the usage tips listed in the Raster Calculator tool help. When multiple Relational or Boolean operators are used in a sequence, the expression requires parentheses. For example, to use the IsNull tool, type it as IsNull, instead of Isnull or isnull. Since the expression entered in the Raster Calculator tool will be run in Python, and Python is case sensitive, it is important to use the correct capitalization of the tool name. When building expressions in the Raster Calculator tool, clicking and double-clicking the various layers, variables, buttons, and tool names on the dialog box will help you to avoid syntax errors that may otherwise be made while typing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |