Relative Content

Tag Archive for pythongdalgeotiff

Force gdal.warp to ignore source file no data-values

I am trying to crop a satellite image (in GeoTIFF format) to the extent of a region of interest (irregularly shaped polygon outlining the area of a glacier) using gdal.warp in Python. While doing this I want to keep the value of the no data-pixels in the original image (in this case 0), and assign a different no data-value to the pixels that are being cut off by the polygon, so that I end up with a final image that includes two kinds of no data-pixels: one for “true” no data in the region of interest and one for no data as a result of cropping the image – basically just the fill values that are being created by gdal.warp.