Ideally I want to create a model in ArcGIS ModelBuilder that will iterate a folder of rasters and output the ones that intersect polygon tiles in another shapefile.
I have the polygon shapefiles saved to a file location and can read them into the model, I have an iterator that is reading through the folder of rasters.
What tool (if existing) will allow me to output the rasters that intersect the polygons in the shapefile?
Tile Index
Selection from Tile Index: Desired Rasters to pull from folder
Attribute table of selection from Tile Index. Name column highlighted matches naming convention of Raster DEMs
Raster DEM folder, expanded in Arc Catalog
EDIT:
I was able to run a batch process since the names of the polygon tiles matched the correlated names of the raster DEMs:
Create a file list to be used for batch processes
Create a file list (export attribute table as dbf in ArcMap)
Open up file list in excel (delete all columns except common name field)
Column B – type in copy “ ” type in location of files you want to copy
Ex: copy Y:\Data\RasterDEMs\
Column C – copy/paste special Column A AS VALUES
Delete column A contents
Column D – .*
Column E – type in location for files to be saved
Column F – concatenate columns B – E
Ex: =CONCATENATE(B1,C1,D1," ",E1)
Sheet 2, Column A – copy/paste special Column F AS VALUES
Save Sheet 2 as tab delimited .txt
close excel and open Sheet2.txt
Save As with extension .bat (batch file)
double click that file and it should open the CMP box and start running
[ “ “ = Space]
For those who wanted to see the data I've added the images.
I'm running ArcGIS 10.3.1
extensions:
Spatial Analyst
3D Analyst
Best Answer
This is a problem that I've encountered many times, getting a disc full of tiles and needing to find the ones that are in/near an area to subset the rasters for building VRT, mosaic dataset or mosaicing (depending on requirements)...
I am not aware of any tool in Model Builder that will help with this, there is a limit to what can be done in model builder, however this kind of operation is very easy in python:
This is a very cut-down tool that I use regularly; beware the AOI and the rasters must be in the same coordinate system.. You can use this in model builder after you have created your own toolbox and added a python script tool, the parameters are Feature Class, Folder and Folder (make them all input for simplicity).
I use sys.argv[] over arcpy.GetParameterAsText() - they both do the same thing but less typing.
This can be further refined using the geometries in the file (point, line or polygon - it doesn't matter):