如何归一化要素类数据?
我现在需要归一化要素表格中的某个字段数据,目标是让数据在0-1之间,我知道公式可以是(x-min(x))/(max(x)-min(x))。我这里有一份适用于ArcGIS Desktop的归一化栅格数据python脚本,如何才能将这个脚本改成适用于ArcGIS Pro并且计算要素类数据归一化的脚本呢?或者有更好的方法解决吗?
谢谢了!
原归一化栅格脚本:
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
rawRasterData = arcpy.GetParameterAsText(0)
NormalizationResultFilePath = arcpy.GetParameterAsText(1)
maxValueDS = arcpy.GetRasterProperties_management(rawRasterData, "MAXIMUM")
maxValue = maxValueDS.getOutput(0)
minValueDS = arcpy.GetRasterProperties_management(rawRasterData, "MINIMUM")
minValue = minValueDS.getOutput(0)
NormalizationRaster = (Raster(rawRasterData) - double(minValue))/(double(maxValue) - double(minValue))
NormalizationRaster.save(NormalizationResultFilePath)
print (" Normalization Success!")
谢谢了!
原归一化栅格脚本:
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
rawRasterData = arcpy.GetParameterAsText(0)
NormalizationResultFilePath = arcpy.GetParameterAsText(1)
maxValueDS = arcpy.GetRasterProperties_management(rawRasterData, "MAXIMUM")
maxValue = maxValueDS.getOutput(0)
minValueDS = arcpy.GetRasterProperties_management(rawRasterData, "MINIMUM")
minValue = minValueDS.getOutput(0)
NormalizationRaster = (Raster(rawRasterData) - double(minValue))/(double(maxValue) - double(minValue))
NormalizationRaster.save(NormalizationResultFilePath)
print (" Normalization Success!")
3 个回复
荡漾梦幻
赞同来自: 李明
https://community.esri.com/mes ... 39131
https://community.esri.com/blo ... -data
AriaGIS
赞同来自:
GADFLY
赞同来自:
要回复问题请先登录或注册
发起人
相关问题
问题状态