I want to allow the user to choose several value from a list of values then later i want to use these values to iterate through a raster data set. But very time i keep getting errors saying the data set is not correct. My code is here:
<SPAN class="keyword token">import</SPAN> arcpy<SPAN class="punctuation token">,</SPAN>os
inputraster <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
sea_level <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
fc <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText<SPAN class="punctuation token">(</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN>
clipraster <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>GetParameterAsText
valuelist <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>x<SPAN class="punctuation token">.</SPAN>strip<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">for</SPAN> x <SPAN class="keyword token">in</SPAN> sea_level<SPAN class="punctuation token">.</SPAN>split<SPAN class="punctuation token">(</SPAN><SPAN class="string token">";"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">for</SPAN> value <SPAN class="keyword token">in</SPAN> valuelist<SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Clip_management<SPAN class="punctuation token">(</SPAN>inputraster<SPAN class="punctuation token">,</SPAN>"<SPAN class="comment token">#",clipraster,fc,"#","ClippingGeometry","MAINTAIN_EXTENT")</SPAN>
clip_raster <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Raster<SPAN class="punctuation token">(</SPAN>clipraster<SPAN class="punctuation token">)</SPAN>
floodedarea <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>outputfolder <SPAN class="operator token">+</SPAN> <SPAN class="string token">"floods"</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>value<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
areasbelow <SPAN class="operator token">=</SPAN> clip_raster <SPAN class="operator token"><=</SPAN> value
areasbelow<SPAN class="punctuation token">.</SPAN>save<SPAN class="punctuation token">(</SPAN>floodedarea<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddMessage<SPAN class="punctuation token">(</SPAN>areasbelow<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>