twadd

ERROR 010328: Syntax error at or near symbol ).

Discussion created by twadd on Nov 1, 2011
Latest reply on Nov 2, 2011 by Lady_Jane
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).

Outcomes