Re: [mapserver-users] MapServer 5.2.1 - Trying to show a band as transparent

2011-05-31 Thread Frank Warmerdam

On 11-05-31 03:31 PM, Eduardo Kanegae wrote:

Hi,

I have a Windows 2008 R2 Server running MapServer 5.2.1 from MS4W pack.

My trouble: I´m trying to display a gdaltindex file ( set of rasters ) but the
image border is not being displayed as expected.

The raster files are all 4-band based, with 3 bands for RGB and the 4th band
for ALPHA channel.
The band 4 has only two possible values: 0 ( for transparent desired area) and
255 for area where RGB bands has content

...

...
OPACITY ALPHA


Eduardo,

I am not clear on what "OPACITY ALPHA" is supposed to do.  I don't think
you need it.


...
PROCESSING "BANDS=1,2,3,4"
PROCESSING "SCALE_1=AUTO"
PROCESSING "SCALE_2=AUTO"
PROCESSING "SCALE_3=AUTO"
PROCESSING "SCALE_4=1,2"
PROCESSING "RESAMPLE=BILINEAR"


SCALE_4=1,2 will transform 1 to 0, and 2 to 255 but the input values are
apparently 0 and 255 already (as I deduce from the qgis snapshot) so I think
you should just omit the SCALE_4 processing option.

There may be bad interactions between RESAMPLE=BILINEAR and the alpha
support.  You might want to try with and without this option.   If this is
an issue try upgrading to MapServer 6 and see if the problem persists.  I
have made significant improvement in raster alpha handling in recent years.

Best regards,
--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Programmer for Rent

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] MapServer 5.2.1 - Trying to show a band as transparent

2011-05-31 Thread Eduardo Kanegae
Hi,

I have a Windows 2008 R2 Server running MapServer 5.2.1 from MS4W pack.

My trouble: I´m trying to display a gdaltindex file ( set of rasters ) but
the image border is not being displayed as expected.

The raster files are all 4-band based, with 3 bands for RGB and the 4th band
for ALPHA channel.
The band 4 has only two possible values: 0 ( for transparent desired area)
and 255 for area where RGB bands has content

References:
1. http://www.sntgeo.com.br/tmp/qgis-shot1.jpg and
http://www.sntgeo.com.br/tmp/qgis-shot2.jpg - raster shown using QGIS
2. http://www.sntgeo.com.br/tmp/mapserver-openlayers.jpg - raster layer as
it´s being shown with MapServer + OpenLayers ( 2.10, using output png)

My mapfile:
...
OUTPUTFORMAT
NAME png24
DRIVER "GD/PNG"
 MIMETYPE "image/png"
IMAGEMODE RGBA
EXTENSION "png"
 TRANSPARENT ON
END

LAYER #-- ras_imagens
NAME "ras_imagens"
 TYPE RASTER
TILEINDEX "/imagens.shp"
 TILEITEM "location"
...
OPACITY ALPHA
...
 PROCESSING "BANDS=1,2,3,4"
PROCESSING "SCALE_1=AUTO"
 PROCESSING "SCALE_2=AUTO"
PROCESSING "SCALE_3=AUTO"
PROCESSING "SCALE_4=1,2"
 PROCESSING "RESAMPLE=BILINEAR"
END


Any hints?

-- 
Eduardo Patto Kanegae
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users