Select to view content in your preferred language

"WEIGHT" field issue in Arc-SDM 10

391
1
01-14-2013 11:12 AM
ScottGunn
Regular Contributor
Hi all,

I'm using the Arc-SDM v. 10 (Spatial Data Modeler) tools in ArcGIS 10.1.  I am trying to run a Weights of Evidence model (WOE) but keep receiving this error, even with the demo MXD and dataset:
PYTHON ERRORS:
Traceback Info:
  File "Z:\SDM\Scripts\NewCalcResp3.py", line 133, in <module>
    gp.Lookup_sa(Temp_Raster,"WEIGHT",Output_Raster)

Error Info:
    <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
ERROR 001000: Lookup field: Field WEIGHT does not exist
Failed to execute (Lookup).


The model seems to run fine until it tries to calculate weights, then I run into this error.  The code in question is:
 if NoDataArg != '#' and gp.describe(Input_Raster).pixeltype.upper().startswith('U'):
            NoDataArg2 = '#'
        else:
            NoDataArg2 = NoDataArg
        RasterLayer = "OutRas_lyr"
        gp.MakeRasterLayer_management(Input_Raster,RasterLayer)
        #++ AddJoin requires and input layer or tableview not Input Raster Dataset.
        gp.AddJoin_management(RasterLayer,"Value",Wts_Table,"CLASS")
        Temp_Raster = os.path.join(gp.scratchworkspace,'temp_raster')
        if gp.exists(Temp_Raster): gp.delete(Temp_Raster)
        gp.CopyRaster_management(RasterLayer,Temp_Raster,'#','#',NoDataArg2)
        gp.Lookup_sa(Temp_Raster,"WEIGHT",Output_Raster)


I understand that gp.Lookup_sa is failing because the weight field does not exist in Temp_Raster, but I'm not sure how to resolve it.  Any advice on how to troubleshoot this issue would be appreciated.  I have emailed one of the SDM folks in charge of the project as well.

Thank you!
0 Kudos
1 Reply
SteveLynch
Esri Regular Contributor
What happens if you inser a gp.BuildRasterAttributeTable_management(Temp_Raster) before the Lookup?

The Temp_Raster might be too large for automatic table building (see http://support.esri.com/en/knowledgebase/techarticles/detail/27056 for limits)

Steve
0 Kudos