Select to view content in your preferred language

Batch merge within another script operation

675
1
12-12-2016 04:00 PM
RichardHargreaves
New Contributor

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.

0 Kudos
1 Reply
FC_Basson
MVP Regular Contributor

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.

def myFunction( raster, val ):
   newval = raster * val
   return newval

for r in rasterlist:
   rmod = myFunction(r, 3.14159265)
0 Kudos