Hi,
I'm brand new to Python and i'm looking to add a merge function within a batch command that processes separate digimap files and creates boolean raster files from them. Any help would be really appreciated.
Not sure if I undestand correctly, but I think you are referring to functions?
4. More Control Flow Tools — Python 3.5.2 documentation
So within a for loop you can call another function for each loop step to return a result e.g.
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">myFunction</SPAN><SPAN class="punctuation token">(</SPAN> raster<SPAN class="punctuation token">,</SPAN> val <SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> newval <SPAN class="operator token">=</SPAN> raster <SPAN class="operator token">*</SPAN> val <SPAN class="keyword token">return</SPAN> newval <SPAN class="keyword token">for</SPAN> r <SPAN class="keyword token">in</SPAN> rasterlist<SPAN class="punctuation token">:</SPAN> rmod <SPAN class="operator token">=</SPAN> myFunction<SPAN class="punctuation token">(</SPAN>r<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">3.14159265</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.