Batch Shapefile Clipping
This is just a quick “note to self” on some interesting information I picked up from the QGIS mailing list today. Kudos to David J. Bakeman for sharing this:
If both the input and the output arguments to ogr2ogr are directories then it will clip all of the shapes in the source directory and write them to the output directory.
So:
ogr2ogr -clipsrc mask.shp output source
Shapefiles are the default so you don’t even need the -f “ESRI Shapefile”.