0

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?

2
  • 1
    Use 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?
    – user30184
    Commented 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
    – Vid1324
    Commented Sep 17, 2021 at 8:10

1 Answer 1

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.