I recently posted an answer to Zonal stats for complete pixels qgis that required clipping a raster in a way that excludes pixels that fall partially outside the mask layer. Here's an illustration:
The best method I could figure out is as follows:
- Polygonize the raster.
- Use Select by location tool to select features in Vectorized layer that fall within the polygon layer.
- Clip raster by mask layer using the selected features of the Vectorized layer as the mask layer. Don't crop the extent.
But this method seems like a lot of steps, and polygonizing a large raster can take a long time.
Is there a better method of clipping a raster and excluding cells that overlap the edge of the mask?
By "better" I mean fewer steps and/or requiring less processing time.