I am trying to clip a raster .tif file with a polygon shapefile using gdalwarp. For the majority of the extent, the results are as expected. But there are several gaps where portions of the raster that appear to clearly overlap the polygon are omitted from the clip. In these areas, raster cells that appear to fall entirely within the polygon boundary are still omitted. Both input files are in the same projected coordinate system.
The top image shows the gdalwarp clip results in black over the input raster in orange and clipping polygon layer in blue.
The bottom image shows the same layers with an additional layer in pink. The additional layer was produced using the Extract by Mask tool in ArcMap, which produces the results that I would have expected from gdalwarp. I am looking for an open source solution though.
I have tried both of the following commands:
gdalwarp -of GTiff -tr 30.0 -30.0 -tap -cutline "C:\\Users...buff2.shp" "C:\\Users...tiled_p.tif" "C:\\Users...4i.tif"
gdalwarp -of GTiff -cutline "C:\\Users...buff2.shp" -crop_to_cutline "C:\\Users...tiled_p.tif" "C:\\Users...4i.tif"
I am on a Windows 10 computer. Unfortunately I cannot reproduce the datasets to share.
Are there ideas for why this might be happening and how I might fix this using gdal or other open-source tools?