[gdal-dev] unwanted transparency of black color produced by gdalwarp

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon May 28 06:15:09 PDT 2012


N D <getgoing555 <at> gmail.com> writes:

> 
> 
> Hello,I am trying to crop and warp the enroute chart tif from FAA's
http://aeronav.faa.gov/Enroute/04-05-2012/ENR_H01.zip package with the following
commands:

1. gdal_translate -of vrt -srcwin  2203 204 21692 7591 ENR_H01.tif ENR_H01.vrt

2. gdalwarp -wm 1000 -t_srs EPSG:3395 -srcnodata 0 -dstalpha -r bilinear 
ENR_H01.vrt   ENR_H01_tmp.tif

Hi,

-srcnodata labels everything that is totally black in you source image as nodata
and as you noticed, black pixels in the image turn to nodata as well.

In your case I would just do "warp and crop" instead of "crop and warp".
Have a try with gdalwarp by using ENR_H01.tif as source and with -te parameter

-te xmin ymin xmax ymax:
    set georeferenced extents of output file to be created (in target SRS). 

You need to get the BBOX in target SRS which is some extra work but at the same
you should not see any black slivers in the warped image.

-Jukka Rahkonen-





More information about the gdal-dev mailing list