我试图在 32 位浮动栅格中重新分类 PixelValue 并得到以下错误:
bw_liss-3_spring_mosaick_gk3_ndvi_mask.tif
Traceback (most recent call last): File
"F:\Daten_Soner\CBD06\Test\NDVI\Spring\Extract\Reclassify_Cloudmask_LISS_Summer.py",
line 29, in <module>
remap = RemapValue([-340282346638528860000000000000000000000,000000,2])
File "C:\Program Files
(x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\ParameterClasses.py", line
806, in __init__
_Remap.__init__(self, remapTable) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\ParameterClasses.py", line
751, in __init__
self.remapTable = [list(record) for record in remapTable]
TypeError: 'long' object is not iterable
我使用以下脚本:
Import arcpy module
import arcpy, os, sys
Check out any necessary licenses
arcpy.CheckOutExtension("Spatial")
Set the workspace environment
from arcpy import env
from arcpy.sa import *
env.workspace = "F:\Daten_Soner\CBD06\Test\NDVI\Spring\Extract"
从工作区获取 TIFFS 列表并打印
rasterList = arcpy.ListRasters()
for raster in rasterList:
print raster
arcpy.CalculateStatistics_management(raster)
# Process: Reclassify
remap = RemapValue([-340282346638528860000000000000000000000,000000,2])
outReclassify = Reclassify(raster, "Value", remap , "NODATA")
outReclassify.save(raster + "_re.tif")
感谢帮助!