[gdal-dev] gdalwarp producing rgb 0 0 0 for input nodata areas

Brian Case rush at winkey.org
Sun Feb 24 09:56:14 PST 2013


you cannot preserve the nodata areas with jpeg output. you will have a
line around your image that is not quite your nodata values.

leave your files as geotiff until you merge them.

you did preserve the nodata with your gdalwarp just in the form of an
alpha band

you can merge your files with gdalwarp in1.tif in2.tif in3.tif out.tif


On Wed, 2013-02-20 at 10:33 -0800, Rick wrote:
> Hi all,
> I have a set of ecw files that I wish to gdalwarp to a new coordinate system
> and convert to jpg.
> I have been using these commands:
> gdal_translate in.ecw out_gt.tif -a_nodata none -of GTiff -co TFW=YES
> gdalwarp -s_srs EPSG:26909 -t_srs EPSG:3005 -of GTiff -co TFW=YES -dstalpha
> out_gt.tif out_warp.tif
> gdal_translate -of JPEG -co "WORLDFILE=YES" out_warp.tif out.jpg
> The first translate works as expected and the nodata values are preserved.
> The gdalwarp command converts the nodata areas to 0,0,0.
> The second translate works as expected and the nodata values are preserved.
> I am using ArcGIS 10.1 to view the results.
> How does one preserve nodata areas via gdalwarp?
> My eventual goal is to merge these data sets but have a need for the interim
> products to have the nodata areas.
> Thanks
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/gdalwarp-producing-rgb-0-0-0-for-input-nodata-areas-tp5035602.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

Brian Case
rush at winkey.org

More information about the gdal-dev mailing list