got my self in a muddle while trying to automate a tool that works for a single point. now trying to automate for many points.%ID% - the point number i'm using (these range from 1-70)%max% - a number in the raster calculator i am making dtm values less than %max% into null values using the followingSetNull("%dtm_1%" < %min%,"%dtm_1%")This worked for my example when i used dtm_1, however i now want to run this for dtm_1, dtm_2, dtm_3... using dtm_%ID%if i try SetNull("%dtm_%ID%%" < %min%,"%dtm_%ID%%") i get an error message Start Time: Wed Apr 25 13:07:51 2012 SetNull("%dtm_%ID%%" < 69.555,"%dtm_%ID%%") ERROR 000539: Error running expression: rcexec() <type 'exceptions.RuntimeError'>: ERROR 000732: Input Raster: Dataset %dtm_%ID%% does not exist or is not supported Failed to execute (Raster Calculator). Failed at Wed Apr 25 13:07:52 2012 (Elapsed Time: 1.00 seconds)how do i get this to work properly?
SetNull("%dtm_1%" < %min%,"%dtm_1%")
if i try SetNull("%dtm_%ID%%" < %min%,"%dtm_%ID%%")
Start Time: Wed Apr 25 13:07:51 2012 SetNull("%dtm_%ID%%" < 69.555,"%dtm_%ID%%") ERROR 000539: Error running expression: rcexec() <type 'exceptions.RuntimeError'>: ERROR 000732: Input Raster: Dataset %dtm_%ID%% does not exist or is not supported Failed to execute (Raster Calculator). Failed at Wed Apr 25 13:07:52 2012 (Elapsed Time: 1.00 seconds)
'SetNull("{0}_{1} < 69.555, "{0}_{1}")'.format("%dtm_%",%ID%)
# %dtm_% = "raster" # %ID% = 1 SetNull("raster1" < 69.555, "raster1")
'SetNull("{0}" < 69.555, "{0}")'.format(r"%raster%")
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.