POST
|
I have used the online help and read up about the error code and as to why my input file may not be opened and i cant see there to be any of the problems mentioned in the help, present in my file. I dont think its an issue with permission as i ran a separate command to check if it would open the input file, which worked. Can any one shed any light on why the file wont open. gp.MultiOutputMapAlgebra_sa("forb2g = CON(forb1g > 0, dem_resample)") This is the error I get: Traceback (most recent call last): File "H:\Internship_Tom_Waddington\New_code\code.py", line 94, in <module> gp.MultiOutputMapAlgebra_sa("forb2g = CON(forb1g > 0, dem_resample)") ExecuteError: ERROR 010316: Unable to open the input raster: FORB1G ERROR 010067: Error in executing grid expression. Failed to execute (MultiOutputMapAlgebra).
... View more
11-15-2011
12:57 AM
|
0
|
2
|
2159
|
POST
|
Even with all the paths the same i.e. C:/path I still keep getting the Error in executing grid expression on the same line of code. Is there anything else that you think may be the cause?
... View more
11-08-2011
05:07 AM
|
0
|
0
|
330
|
POST
|
Can any one help, explain and possible provide a solution as to why this code keeps producing and error. Everything else runs up to this point and every variable is defined. gp.MultiOutputMapAlgebra_sa("H:\Internship_Tom_Waddington\New_code/forest_b2grd = CON('H:\Internship_Tom_Waddington\New_code/forest_b1grd > 0,H:\Internship_Tom_Waddington\New_code/dem_resample')") Traceback (most recent call last): File "H:\Internship_Tom_Waddington\New_code\new_code.py", line 86, in <module> gp.MultiOutputMapAlgebra_sa("H:\Internship_Tom_Waddington\New_code/forest_b2grd = CON('H:\Internship_Tom_Waddington\New_code/forest_b1grd > 0,H:\Internship_Tom_Waddington\New_code/dem_resample')") ExecuteError: ERROR 010067: Error in executing grid expression. Failed to execute (MultiOutputMapAlgebra).
... View more
11-08-2011
04:49 AM
|
0
|
3
|
1742
|
POST
|
Thank you that solved the problem right away. You couldnt possibly shed a light on to this issue too could you? # Local variables... OutCurvatureRaster = workspace + "curv" InZFactor = "1.0" OutProfileCurveRaster = workspace + "curv_profile" OutPlanCurveRaster = workspace + "curv_plan" # Process: Curvature... gp.Curvature_3d(Resample_raster, OutCurvatureRaster, InZFactor, OutProfileCurveRaster, OutPlanCurveRaster) # we do not need two of the rasters...delete them gp.delete_management(OutCurvatureRaster) gp.delete_management(OutProfileCurveRaster) # Process: MapAlgebra, classification of plan curvature... gp.MultiOutputMapAlgebra_sa(workspace + "curv_plan_1" = CON(workspace + curv_plan "> 3,3,0")) The script section is taken from the next stage of the previous script but wont run because it keeps saying there is a syntax error in the final line shown. In particular this occurs and keeps highlighting " with in the condition string.
... View more
11-07-2011
03:17 AM
|
0
|
0
|
190
|
POST
|
This is a simple script that I have used many times before, the only difference this time is that I am not using the exact directory. But instead a workspace + "" method so that the final script and be used on any computer (the workspace is initially defined at the beginning of the script). Here I the script, I have looked it over several times and so have my colleges this is only one part of the main script but there are so many errors with it even though it has previously work so trying to debug them one at a time. Can some one please explain why when I run the Ascii to raster conversion the 'Parameters are not valid'? (This happens on the first conversion attempt) Here is the script that i have been using. # Import system modules import sys, string, os, arcgisscripting #Create the Geoprocessor object gp = arcgisscripting.create(9.2) #Check out any necessary licenses gp.CheckOutExtension("spatial") # Check out ArcGIS 3D Analyst extension license gp.CheckOutExtension("3d") gp.CheckOutExtension("arc") gp.overwriteoutput = 1 # Load required toolboxes... gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Conversion Tools.tbx") gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/3D Analyst Tools.tbx") gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Spatial Analyst Tools.tbx") gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Data Management Tools.tbx") gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Spatial Statistics Tools.tbx") #ASCIIToRaster workspace = "H:\tom\old_code\data/" ASCII_file = "H:\tom\old_code\data/dhm25.asc" #sys.argv[1] ASCIIFOR_file = "H:\tom\old_code\data/forest.asc" #sys.argv[2] Output_DEM_raster = workspace + "dem" Resample_raster = workspace + "dem_resample" Resample_for = workspace + "for_resample" # Process: ASCIIToRaster_conversion print gp.GetMessages() gp.ASCIIToRaster_conversion(ASCII_file, Output_DEM_raster, "FLOAT") gp.ASCIIToRaster_conversion(ASCIIFOR_file, workspace + "forest", "FLOAT")
... View more
11-06-2011
10:55 PM
|
0
|
3
|
2386
|
POST
|
I tried what you suggested and now i get this error message. ('H:\\Internship_Tom_Waddington\\old_code\\data\\rel_rast = con((H:\\Internship_Tom_Waddington\\old_code\\data\\curv_plan_1', ' < 3) and (H:\\Internship_Tom_Waddington\\old_code\\data\\slope', ' >= 30) and (H:\\Internship_Tom_Waddington\\old_code\\data\\slope', '<= 60) and (H:\\Internship_Tom_Waddington\\old_code\\data\\dem_resample', ' > 900), 1, 0) ') Traceback (most recent call last): File "H:\Internship_Tom_Waddington\old_code\codes\path_my_old_25a.py", line 79, in <module> gp.MultiOutputMapAlgebra_sa(InExpression1) RuntimeError: Object: Error in executing tool >>>
... View more
11-02-2011
12:31 AM
|
0
|
0
|
1674
|
POST
|
Hi im pretty new to python but im developing a code to identify automatic release zones for avalanches. i have the code working every time when i use the specific directory but when changing it to a generic directory so it can be used with different data sets with minimal changes other than changing the workspace i keep getting syntax errors ive managed to get the code working up to this point (shown below) but cant work out why it keeps presenting me with the error. # Process: Release raster... curv_plan_1 = workspace + "\\curv_plan_1" slope = workspace + "\\slope" dem_resample = workspace + "\\dem_resample" InExpression1 = workspace + "\\rel_rast" + " = con((" + curv_plan_1 + " < 3) and (" + slope + " >= 30) and (" + slope + "<= 60) and (" + dem_resample + " > 900), 1, 0) " print InExpression1 gp.MultiOutputMapAlgebra_sa(InExpression1) Here is the print and error output that it comes with. H:\Internship_Tom_Waddington\old_code\data\rel_rast = con((H:\Internship_Tom_Waddington\old_code\data\curv_plan_1 < 3) and (H:\Internship_Tom_Waddington\old_code\data\slope >= 30) and (H:\Internship_Tom_Waddington\old_code\data\slope<= 60) and (H:\Internship_Tom_Waddington\old_code\data\dem_resample > 900), 1, 0) Traceback (most recent call last): File "H:\Internship_Tom_Waddington\old_code\codes\path_my_old_25a.py", line 79, in <module> gp.MultiOutputMapAlgebra_sa(InExpression1) ExecuteError: ERROR 010328: Syntax error at or near symbol ). ERROR 010267: Syntax error in parsing grid expression. Failed to execute (MultiOutputMapAlgebra).
... View more
11-01-2011
08:39 AM
|
0
|
3
|
9099
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|