Result of Euclidean distance not able to reclassify

5892
11
Jump to solution
03-26-2016 10:09 AM
Mehretab
Occasional Contributor II

I am running a suitablity analysis model and as one of the many process with in the model it creates an euclidean distance on a rasterized inputes and subsequently it has to reclassify this output data. It is throwing an error exception (    ERROR 999999: Error executing function. the table was not found.[VAT_Reclass_EucD1] ) Failed to to excute (Reclassify). the output of the euclidean distacne tool is floating-point grids and there is a maximum amount of values that can be stored. Is there a way to make the model for such a big area because it works with small area or Country.

0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor

My suggestion:

Reclassify works best with an integer raster with a raster table. It seems to work around float input with a small number of values but if you want to work with a larger area you are going to have to change its input to integer and build the table.

You can do this by passing the output of Euclidean Distance through IntBuild Raster Attribute Table and then to Reclassify.

View solution in original post

0 Kudos
11 Replies
DanPatterson_Retired
MVP Emeritus

Do you have an image/list of the ranges you are using in the reclassification?  Also, provide details about the file source and destinations paths to ensure that they comply with what is required for working with rasters.

0 Kudos
curtvprice
MVP Esteemed Contributor

My suggestion:

Reclassify works best with an integer raster with a raster table. It seems to work around float input with a small number of values but if you want to work with a larger area you are going to have to change its input to integer and build the table.

You can do this by passing the output of Euclidean Distance through IntBuild Raster Attribute Table and then to Reclassify.

0 Kudos
Mehretab
Occasional Contributor II

Thanks Curtis Price,

Here is small part of the code which matters most in the above posted issue. The code works fine and completes the processes successfully if the extent of the area is small but it stops as I mentions it on reclassifying the floating output form the euclidean distance when the extent is big. I tried also as you suggested to convert the floating point grid to int and then create attribute table form the int grid but it is giving me some errors  like "int() argument must be a string or a number, not 'Raster' "  or roads_euclDist1=int(float("roads_euclDist"))" ValueError: could not convert string to float: roads_euclDist" Am I missing a workflow here?

electricitygrid_euclDist = EucDistance(ElectricityGridClip_raster, 10000, cellSize, "#")

  arcpy.AddMessage("Euclidean Distance electricity grid created successfully!")

   #electricitygrid_euclDist = int(electricitygrid_euclDist) / I commented it out but it gave me the first error listed above

  arcpy.BuildRasterAttributeTable_management(int(electricitygrid_euclDist), "Overwrite")

  arcpy.AddMessage("Euclidean Distance electricity grid table created successfully!")

  # Execute Reclassify

  myremap1 = RemapRange([[200, 1000, 10], [1000, 2000, 9], [2000, 3000, 8], [3000, 4000, 7], [4000, 5000, 6],[5000, 6000, 5],[6000, 7000, 4],[7000, 8000, 3],[8000, 9000, 2],[9000, buffer_electricitygrid, 1]])

  electricitygrid_euclDist_reclass = Reclassify(electricitygrid_euclDist, "Value", myremap1,"NODATA")

  arcpy.AddMessage("Electricity grid reclassified successfully!")

Thanks

0 Kudos
DanPatterson_Retired
MVP Emeritus

you used lowercase 'int' which is a Python method... for the spatial analyst, you need 'Int' in proper case

curtvprice
MVP Esteemed Contributor

1. Dan is right on. int() is the python int function, Int will call the arcpy.da.Int tool, which is what you need.

2. BuildRasterAttributeTable must be run your raster that exists already. The default options are what you want to be most efficient (if the table is there, no need to rebuild it).

electricitygrid_euclDistI = Int(electricitygrid_euclDist) 
arcpy.BuildRasterAttributeTable_management(electricitygrid_euclDistI)
Mehretab
Occasional Contributor II

The error followed after this was jus a sytem error. I was running it on my labtop and when I runned it on desktop with better processor and ram it worked fine and once again thanks Cartis and Dan.

0 Kudos
curtvprice
MVP Esteemed Contributor

Sounds like you needed more memory!

Mehretab
Occasional Contributor II

Thanks Dan Patternson and Curtis Price

I followed the workflow above and it seems the code is write and working. I save the intermediate results to check if Int tool and the create table are working and I found out there is result form these tools. The model works for small extent again but it still fails for a large extent. here are the part of the code and the error I am getting. The reclassify is not getting the output form the result before.

roads_euclDist = EucDistance(RoadsClip_raster, buffer_roads, cellSize, "#")

arcpy.AddMessage("Euclidean Distance roads created successfully!")

roads_euclDistI =Int(roads_euclDist)

arcpy.AddMessage("Euclidean Distance changed to interger successfully!")

        #roads_euclDistI.save("roadEculDis") #successfully saved.

arcpy.BuildRasterAttributeTable_management(roads_euclDistI)

arcpy.AddMessage("BuildRasterAttributeTable_management successful!")

        #roads_euclDistI.save("roadEculDisTab")#successfully saved

  # Execute Reclassify for roads raster

myremap2 = RemapRange([[100, 1000, 10], [1000, 2000, 9], [2000, 3000, 8], [3000, 4000, 7], [4000, 5000, 6],[5000, 6000, 5],[6000, 7000, 4],[7000, 8000, 3],[8000, 9000, 2],[9000, buffer_roads, 1]])

  roads_euclDist_reclass = Reclassify(roads_euclDistI, "Value", myremap2,"NODATA")

  arcpy.AddMessage("Roads reclassified successfully!")

ExecuteError: ERROR 999999: Error executing function.

The table was not found. [VAT_Reclass_int_1]

Failed to execute (Reclassify).

0 Kudos
DanPatterson_Retired
MVP Emeritus

Adding this line to code...

arcpy.AddMessage("Euclidean Distance roads created successfully!")

doesn't mean anything was successful... all it means is that it didn't produce a syntax or other type of untrapped error.  In fact, the preceding line could be a dismal failure and it would still print that message

0 Kudos