Select to view content in your preferred language

Move files from many folders to one with python

399
1
09-01-2022 10:41 AM
LostInTheSauce
New Contributor

Hello,

 

I've downloaded over 80 NAIP files and they all went into their own folders. I want to batch trim the imagery to the polygon that they came with so I can mosaic them all together without the null pixel borders. Is there a way to do this in python? 

 

  • I assume I'll have to move all the files out of their own folder and into one common folder to make the script easier (or not?)
  • I will also have to figure out how to call them because they are numbered the same but named differently:
    • i.e. the image is called ortho_1-1_hn_s_fl133_2021_1.sid & the polygon is 
      ortho_1-1_hn_fl133_2021_1
  • hoping to do this in the python window in Pro

 

Thanks for your help!

0 Kudos
1 Reply
DannyMcVey
Esri Alum

What your planning sounds feasible with python. Others may have more detailed suggestions, but I want to point out that there is some related info and code samples here: Create lists of data—ArcGIS Pro | Documentation.

 

You won't necessarily need to move all the files into one common folder.

0 Kudos