ds_img.FlushCache() did the trick! On Fri, Aug 5, 2022 at 4:44 PM Denis Rykov <ryk...@gmail.com> wrote:
> Hi, > > I would expect these 2 ways of running GDAL warp should produce the same > results. > > gdalwarp -t_srs EPSG:3857 \ > -te 558728 5789851 1242296 7544030 \ > -ts 500 500 \ > "WMS: > http://127.0.0.1:8080/api/resource/5840/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=test_rounds&SRS=EPSG:4326&BBOX=-180.000000,-85.051129,180.000000,85.051129" > \ > /tmp/result1.tif > > and > > from osgeo import gdal > from osgeo import gdalconst > > width = height = 500 > url = "WMS: > http://127.0.0.1:8080/api/resource/5840/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=test_rounds&SRS=EPSG:4326&BBOX=-180.000000,-85.051129,180.000000,85.051129 > " > ds = gdal.Open(url, gdalconst.GA_ReadOnly) > ds_img = gdal.Warp( > "/tmp/result2.tif", > ds, > options=gdal.WarpOptions( > width=width, > height=height, > outputBounds=(558728, 5789851, 1242296, 7544030), > dstSRS="EPSG:3857", > ), > ) > > But in the first case I get what I expect but in the second one I get a > raster with right spatial extent but 0 in all bands. > > What am I missing? >
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev