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

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Mon Feb 17 11:33:25 PST 2020


Hi,

What I think first is that your output bounds do not hit your source data
but with the information that you provide it is impossible to know.

Have you considered to use the gdalwarp executable for testing? If you can't
make it to work please send a link to some test data.

-Jukka Rahkonen-



gustavorsantos wrote
> 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
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





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


More information about the gdal-dev mailing list