Selon Jukka Rahkonen <[email protected]>: > Hi, > > I thought this would be easy but it was not. > > I have a mosaic of images which do not fill the whole bounding box of the > area. > I made a .VRT file the images and converted the virtual raster into geotiff. > Now > I have a nice mosaic but it has black boxes in the areas where I do not have > source data. An example of the result is here > http://latuviitta.org/documents/nodata_3.tif > > I would rather paint nodata areas with white instead of black. But how can I > make it? I thought that gdalwarp -dstnodata would do it but areas of missing > source data remains black > gdalwarp -dstnodata "255,255,255" nodata.vrt nodata_3.tif > > The following command does make the black box white but unfortunately is is > also > changing everything that was black in the orininal images, including all the > texts, into white: > gdalwarp -dstnodata "255,255,255" -srcnodata "0,0,0" nodata.vrt nodata_3.tif > > So what is the correct way to do this simple task?
Jukka, Several options : - use the -addalpha option of gdalbuildvrt - use nearblack -setalpha ( http://gdal.org/nearblack.html ) ? - cheat a bit and create a white image that you add as the first position in your VRT. This can be a single pixel image that you artifically expand to full VRT size, like this : <SrcRect xOff="0" yOff="0" xSize="1" ySize="1"/> <DstRect xOff="0" yOff="0" xSize="replace_by_vrt_x_size" ySize="replace_by_vrt_y_size"/> Best regards, Even _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
