需要 Spatial Analyst 许可。
摘要
通过用户指定的最小值(隶属度为 0)到用户定义的最大值(分配的隶属度为 1)之间的线性变换来定义模糊隶属度函数。
讨论
使用 FuzzyLinear 对象的工具:模糊隶属度。
线性函数的适用条件为:在正斜率情况下,较小值优先于较大值呈线性增加,而对于负斜率情况,则与此相反。
线性函数不使用负数。
语法
FuzzyLinear (minimum, maximum)
参数 | 说明 | 数据类型 |
minimum | 隶属度将为 0 的值。如果 minimum 小于 maximum,则线性函数的斜率为正。如果 minimum 大于 maximum,则线性函数的斜率为负。 (默认值为 Minimum of the input) | Double |
maximum | 隶属度将为 1 的值。如果 maximum 大于 minimum,则线性函数的斜率为正。如果 maximum 小于 minimum,则线性函数的斜率为负。 (默认值为 Maximum of the input) | Double |
属性
属性 | 说明 | 数据类型 |
minimum (读写) | The value that will have a membership of 0. If the minimum value is less than the maximum, the linear function will have a positive slope. If the minimum value is greater than the maximum, the slope will have a negative slope. | Double |
maximum (读写) | The value that will have a membership of 1. If the maximum value is greater than the minimum, the linear function will have a positive slope. If the maximum value is less than the minimum, the slope will have a negative slope. | Double |
代码实例
FuzzyLinear 示例 1(Python 窗口)
演示如何在 Python 窗口下创建 FuzzyLinear 类,并通过 FuzzyMembership 工具使用该类。
import arcpy
from arcpy.sa import *
from arcpy import env
env.workspace = "c:/sapyexamples/data"
outFzyMember = FuzzyMembership("as_std", FuzzyLinear(12, 16))
outFzyMember.save("c:/sapyexamples/fzyline")
FuzzyLinear 示例 2(独立脚本)
使用 FuzzyLinear 类执行 FuzzyMembership。
# Name: FuzzyLinear_Ex_02.py
# Description: Scales input raster data into values ranging from zero to one
# indicating the strength of a membership in a set.
# Requirements: Spatial Analyst Extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/sapyexamples/data"
# Set local variables
inRaster = "as_std"
# Create the FuzzyLinear algorithm object
min = 19
max = 22
myFuzzyAlgorithm = FuzzyLinear(min, max)
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute FuzzyMembership
outFuzzyMember = FuzzyMembership(inRaster, myFuzzyAlgorithm)
# Save the output
outFuzzyMember.save("c:/sapyexamples/fzyline2")