[Gdal-dev] gdalwarp nodata

Richard Greenwood richard.greenwood at gmail.com
Sun Nov 14 10:33:03 EST 2004


On Sun, 14 Nov 2004 00:03:34 -0500, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Rich,
> 
> OK, I have finally connected up the alpha support properly through
> the warp architecture - at least I think I have.  It is now possible
> to overlay an image with alpha values on another image with alpha values
> and get proper mixing, and proper setting of merged alpha values in the
> output image.
> 
> You might want to grab a nightly snapshot or build from CVS if you are
> interested in taking advantage of this.
> 
> gdalwarp now has -srcalpha and -dstalpha switches. -srcalpha will be
> implicitly enabled if the last band of thei input file is recognised as
> being an alpha band.  Likewise -dstalpha will be automatically set if the
> destination file already exists, and the last band (or perhaps the next
> band after the bands being transferred?) is marked as an alpha band.
> 
> If you are creating an output file and want an alpha band you need to set
> the -dstalpha explicitly, even if the source file has an alpha band.
> 

Frank,

Thanks! 

Unfortunately, I am still struggling with the Python script for your
previous email. (I am a Python novice). Working in the FWTools0.9.3
environment which includes Python 2.2.1 I get the following error when
trying to run the script:

:0.Traceback (most recent call last):
  File "rgba.py", line 44, in ?
    dst_ds.GetRasterBand(4).WriteArray(alpha,0,iY)
  File "C:\Program Files\FWTools0.9.3\pymod\gdal.py", line 721, in WriteArray
    return gdalnumeric.BandWriteArray( self, array, xoff, yoff )
  File "C:\Program Files\FWTools0.9.3\pymod\gdalnumeric.py", line 179,
in BandWriteArray
    datatype = NumericTypeCodeToGDALTypeCode( array.typecode() )
  File "C:\Program Files\FWTools0.9.3\pymod\gdalnumeric.py", line 219,
in NumericTypeCodeToGDALTypeCode
    elif numeric_code == UnsignedInt16:
NameError: global name 'UnsignedInt16' is not defined

Do I need numpy?

Rich

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the Gdal-dev mailing list