[Qgis-user] Four band raster displaying funny

2013-12-02 Thread Jonathan Moules
Hi List, I've got a 4 band raster aerial photography (RGBI) that comprises lots of tiles. I've merged some of the tiles together with: gdal_merge -o 1.tif -of GTiff -co TILED=YES -co BIGTIFF=YES -co COMPRESS=JPEG -co JPEG_QUALITY=50 -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 --optfile tiff_list.txt

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Jukka Rahkonen
Jonathan Moules jonathanmoules@... writes: Hi List, I've got a 4 band raster aerial photography (RGBI) that comprises lots of tiles. I've merged some of the tiles together with: gdal_merge -o 1.tif -of GTiff -co TILED=YES -co BIGTIFF=YES -co COMPRESS=JPEG -co JPEG_QUALITY=50 -co

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Andrew Harfoot
Hi Jonathan, Is it possible that QGIS is using the infrared band as an alpha channel? This might explain the whitening effect, especially in non-vegetated areas. I would check the Layer properties Transparency tab to see whether anything is set as the

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Andrew Harfoot
PS. gdalwarp offers more flexibility when mosaicing rasters, and is better at memory management. I have just noticed that in GDAL 1.10 and above there is an gdalwarp option -setci that 'Sets the color interpretation of the bands of the target dataset from the

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Jonathan Moules
Hi Andy, Yep, that was it. I didn't know QGIS could do that; another good example of software trying to be smart and confusing the poor user. :-) I didn't know gdalwarp could do mosaicing too. I'll have to test it. I'll ask on the gdal list if I want to try the -setci parameter. Many

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Andrew Harfoot
I think QGIS is innocent in this - if a band is set as an alpha channel then it should be handled as such by default in a viewer (so mark down Arc for not using the alpha information!). GDAL is the culprit as it is adding the alpha interpretation without being prompted. I have just replicated

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Jonathan Moules
Hi Andy, I guess that makes sense. Relating to gdalwarp: - Output files by default are larger than gdal_merge. - But they can be much smaller. You have to set *both* -wm and --config GDAL_CACHEMAX - if you only set -wm, then the file is actually larger! - gdal_merge seems to do something that

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Andrew Harfoot
Interesting! Just found that you can override the GDAL behaviour of adding alpha interpretation (this is the default as described in the GTiff format spec here http://www.gdal.org/frmt_gtiff.html) by adding the GDAL -co command PHOTOMETRIC=RGB. Not sure how this tallys with the YCBCR colour

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Jonathan Moules
Further testing indicates that the same (optimal) result can be had using a combination of a vrt and gdal_translate without having to manually bother with memory management. dir /b /s *.tif tiff_list.txt REM Builds a VRT. A VRT is basically just a XML file saying what all the source tif

Re: [Qgis-user] Four band raster displaying funny

2013-12-02 Thread Jukka Rahkonen
Jonathan Moules jonathanmoules@... writes: Further testing indicates that the same (optimal) result can be had using a combination of a vrt and gdal_translate without having to manually bother with memory management. Hi, I can confirm that question is in GDAL which by default considers