Batch Merge Shape Files
I have a large quantity of UK shape files from the Ordnance Survey OpenOS Data catalogue (VectorMap District). The data is divided into 10km tiles and each tile has up to 14 different shape files (point, line and polygon). Each tile is in its own folder and all files are named the same way, ie. "Road_Line.shp" or "Height.shp" in each folder.
Is there a way that I can merge all "Height" or "Road" files in a batch, rather than having to manually select each individual file through the Merge tool. Is there a way of merging files with the same name, that sit within different sub-folders? I have looked at the batch option for Merge, but it does not appear to do what I need.
Mapping Center Answer:
Yes, you can merge in a batch mode using Python Scripting or Iterators in Model Builder. In python, you would need to loop through each subfolder and then merge the files. I have created a sample script for your case, which is attached here.
You can modify the attached script in a text editor and then load it in a python window and run it. This script will merge all your roads/height shapefiles in one process.
Hope this helps!
If you would like to post a comment, please login.