模型
介绍
工具位置:Modeler–>Model Marker
工具栏:Edit–>Tools
逻辑处理常用Functions:
声明 | 说明 |
---|---|
CONDITIONAL { (<test1>) <arg1> , (<test2>) <arg2> , ... } | 条件<test1>正确则赋予<arg1>的值 条件<test2>正确则赋予<arg2>的值 |
EITHER <arg1> IF ( <test> ) OR <arg2> OTHERWISE | test条件成立,则赋予arg1的值 失败则赋予arg2的值 |
例子:
- 分离出像素为1的地方
$n1_20071129class2 == 5
说明:$n1_20071129class2
为图层变量,一定要带有$,不然它不认识 - 取DEM(高程)<100,SLOPE(坡度)<12°且是林地的地方
EITHER 1 IF ( $n6_dem < 100 or $n7_slope < 12 or $n3_plowland ) OR 0 OTHERWISE
EITHER $n3_plowland IF ( $n6_dem < 100 or $n7_slope < 12 ) OR 0 OTHERWISE
说明:$n3_plowland
为林地的二值图(有值为1,无值为0),$n6_dem
为DEM数据,$n7_slope
为坡度数据
- 合并两个图像
$n1_img_1 or $n2_img_2
说明:$n1_img_1,$n1_img_2
为两张二值化的专题图 - 去除两个图像公共部分
$n1_img_1 - $n2_img_2
- 将6个种类数据合成一个图像
CONDITIONAL { ( $n8_plowland_real ) 1 , ( $n22_construction_real ) 2 , ( $n27_intertidal_zone_real ) 3 ,( $n31_forest_real ) 4 ,( $n33_unused_real ) 5 ,( $n34_water_real ) 6 }
例 从监督分类后的图像中分离出水体
模型
输入图像
处理逻辑
水体在图像中的值为1(查看方法:打开图像,菜单栏–>Raster–>Attributes)
输出图像
处理结果
水的区域才有值(value=1)