I have a 200x200 GeoTIFF from which I am trying to create multiple polygons. I am using different range values to generate different polygons. However, the inverse of the polygons I want are being generated for some of the range values, possibly because the pixels are hitting the edge of the TIFF. How can I change the TIFF to a 201x201 adding a 1 pixel thick layer around the outside with the extra pixels holding nodata values?
-
1Use gdalwarp gdal.org/programs/gdalwarp.html with -te that you can calculate by using the current extent and pixel size. Do you rather want 202x202 pixels?– user30184Commented Sep 16, 2021 at 20:57
-
202x202 would be fine. There just needs to be a thin band around the outside of the tif that holds 0 values– Vid1324Commented Sep 17, 2021 at 8:10
Add a comment
|
1 Answer
You can use gdal.warp to specify the new dimensions, e.g.,
gdalwarp.exe -te xmin ymin xmax ymax old_extent.tif new_extent.tif