Aahaa, the problem was out_ar[:] = data
while I was using out_ara = data Thank you! Jachym po 25. 5. 2020 v 11:14 odesÃlatel Even Rouault <[email protected]> napsal: > > On lundi 25 mai 2020 10:44:10 CEST Jachym Cepicky wrote: > > > Hi all, > > > > > > I have some python code inside of VRT file, but I can not produce > > > reasonable output with gdal_transalte. All the input data do look ok, > > > even when I print() the values I would like to store, the data are > > > displayed, but the resulting TIFF file is just empty, any hint how to > > > approach? I've tested it on gdal 2.2 as well as 3.8, so I assume, I do > > > something wrong here. The minimal code looks like > > > > > > import numpy as np > > > import copy > > > def blur(in_ar, out_ar, xoff, yoff, xsize, ysize, raster_xsize, > > > raster_ysize, buf_radius, gt, **kwargs): > > > out_ar = copy.copy(in_ar[0]) > > > print(out_ar) > > > return out_ar > > > > > > Any hint? > > > > Actually, just realizing that you just don't follow the expectations of the > > pixel function. The function should not return an array: it must modify in > place > > the provided out_ar argument. > > Like all examples at > > https://gdal.org/drivers/raster/vrt.html#using-derived-bands-with-pixel-functions-in-python > > > > Even > > > > -- > > Spatialys - Geospatial professional services > > http://www.spatialys.com -- Jachym Cepicky e-mail: jachym.cepicky gmail com URL: http://les-ejk.cz GPG: http://les-ejk.cz/pgp/JachymCepicky.pgp _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
