[gdal-dev] gdalWarp generates a black image when I use the outputBounds option

gustavorsantos gustavo.r.santos9 at gmail.com
Mon Feb 17 10:18:47 PST 2020


Hi,

I am trying to crop a .tiff image. However, when I use the outputBounds
option the output file is not what I was expecting.

Here is my fuction code:

def warp(t):
    bounds = t.getMercatorCorners() #calculates the minX, minY, maxX and
maxY
    list(bounds)
    raster = gdal.Open("img/pre/104001001ACD9F00_a_R1C1.tif",
gdal.GA_ReadOnly)

    outputTile = gdal.Warp("img/pos/warp_test.tif", raster,
dstSRS="EPSG:3857", resampleAlg=gdal.GRA_Cubic, height=256, width=256,
outputBounds=bounds, outputBoundsSRS="EPSG:3857")
    outputTile = None

    raster = None

Thanks



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list