Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-27 Thread William Kyngesburye
I missed the SourceTransferType parameter, that worked if I used a simple Int16. thanks > On Apr 27, 2018, at 2:32 PM, Even Rouault wrote: > > On vendredi 27 avril 2018 12:42:16 CEST William Kyngesburye wrote: > > OK, it worked as vrt of a vrt. Memory not an issue. > > > > But I have a new pr

Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-27 Thread Even Rouault
On vendredi 27 avril 2018 12:42:16 CEST William Kyngesburye wrote: > OK, it worked as vrt of a vrt. Memory not an issue. > > But I have a new problem. One vrt I want to instead do > -29 (caspian sea, > -29 in SRTM data). The whole region evaluates to 1 (true). It looks like > the in_ar[] is ge

Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-27 Thread William Kyngesburye
I tried: out_ar[:] = ((in_ar[0] + 29) > 0) to try to remove the suspected truncation - bring -29 up to 0 before it's truncated - but then elevation 227 is false and everything else is true (<=226, >=228) > On Apr 27, 2018, at 12:42 PM, William Kyngesburye > wrote: > > OK, it worked as vrt o

Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-27 Thread William Kyngesburye
OK, it worked as vrt of a vrt. Memory not an issue. But I have a new problem. One vrt I want to instead do > -29 (caspian sea, -29 in SRTM data). The whole region evaluates to 1 (true). It looks like the in_ar[] is getting truncated to an unsigned byte, 0-255, from its orignal Int16. Testi

Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-26 Thread William Kyngesburye
So, if the gdal library queries for a region of the vrt (ie processing it in chunks), the numpy array will be just that region? I'll give it a try. What about something like viewing the whole vrt in QGIS - will it be read in chunks as well? IOW, is it the GDAL library that breaks it into chunk

Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-26 Thread Even Rouault
On jeudi 26 avril 2018 12:56:10 CEST William Kyngesburye wrote: > So, a vrt of a vrt? Yes > > I wanted to avoid that, because as I understand the source, it reads each > raster in the derived band as a single numpy array, which would be all the > tiled rasters together. No, if you use gdal_tr

Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-26 Thread William Kyngesburye
So, a vrt of a vrt? I wanted to avoid that, because as I understand the source, it reads each raster in the derived band as a single numpy array, which would be all the tiled rasters together. Most of the vrts that I want to process this way are huge, GBs. I guess I can make a derived band vr

Re: [gdal-dev] VRT pixel functions on tiled vrt

2018-04-26 Thread Even Rouault
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

[gdal-dev] VRT pixel functions on tiled vrt

2018-04-26 Thread William Kyngesburye
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 t