[gdal-dev] VRT pixel functions on tiled vrt

Even Rouault even.rouault at spatialys.com
Thu Apr 26 10:41:40 PDT 2018


On jeudi 26 avril 2018 08:22:05 CEST William Kyngesburye wrote:
> I'm trying to add a pixel function (Python) to a vrt where there are
> multiple rasters (ComplexSource) tiled together (that is, not stacked like
> an RGB image).  When I translate the vrt to a tif, only the first
> ComplexSource is processed, the rest on the raster is set to 0.
> 
> I got the basics of the functin from the vrt docs, and it does work, for the
> first raster tile.  Maybe the python notation for calculating the numpy
> array is wrong?
> 
> The original vrt is created from gdalbuildvrt.  This is the vrt thru the
> first 2 rasters:

William,

in a VRTDerivedRasterBand, the sources are considered to be a stack, and in_ar[0] will return 
the first source and in_ar[1] the seconded one.

What you need to do is create a regular tiled VRT, and use that one has the single source of a 
VRTDerivedRasterBand

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180426/83a0827a/attachment.html>


More information about the gdal-dev mailing list