-1

I am trying to reclassify a PixelValue in a 32 bit floating raster and get the following error:

 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

I use the following script:

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"

Get a list of TIFFS from the workspace and print

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")

Thanks for help!

Pavel Anossov
  • 60,842
  • 14
  • 151
  • 124

1 Answers1

1

RemapValue takes a list of lists ([[oldValue, newValue],...]) while you pass just a list.

wRAR
  • 25,009
  • 4
  • 84
  • 97
  • I just want to reclassify one value. What do I have to write instead of `RemapValue` `@wRAR` –  Apr 02 '13 at 11:53
  • 1
    @SonerÜreyen no idea, I don't know what is `arcpy`, I've just read the documentation for you. – wRAR Apr 02 '13 at 11:55