I've tried to come up with an open-source equivalent to the following process in ArcGIS 10.3:
- Spatial Analyst Toolbox > Extract by Mask
- target input: 1" SRTM DEM in EPSG 4019
- mask layer: single rectangular polygon, shapefile in EPSG 4283
- Environment Settings: Snap Raster to target input, output coordinate system EPSG 4283
This gets me a 'perfect' clip - no changes to pixel size or alignment, identical cell values in the output. The output doesn't align perfectly to the clipping polygon of course, but I don't need it to. Arc just extracts all the cells intersecting the polygon (although I note that the top-most and right-most columns are set to no-data, presumably because their upper-right corners were outside the bounding box).
I've worked out one solution using GRASS 7 and GDAL processing tools in QGIS 2.14.3:
- Create a mapset and import the raster to be clipped
- Run g.region.multiple.raster so that region settings match the imported dataset
- Use v.in.ogr to import the bounding box shapefile
- Use v.to.rast.constant to convert the bounding box to a raster with value 1 for all cells. The output is aligned with the input due to the region settings.
- Use g.region.zoom with the new raster boundary to shrink the region without altering cell size or alignment
- use r.out.gdal.geotiff to export the source dataset. Only the area within the updated region is exported.
- Use gdalwarp to re-project the output .tif in EPSG 4283
The output is nearly identical to the ESRI workflow, but where ESRI set the top-most and right-most columns to no-data, GRASS just didn't export them. Fine by me.
Can an equivalent procedure be run in QGIS without using GRASS?