<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Jukka,<br>
<br>
Strange. When I reviewed the source code it looked like
Mapserver would refused to classify any 24/32 bit image; I must
have missed something. So I tried your mapfile with shp2img
v6.0.0 on a 24bit image and it worked! Then I added<br>
<br>
PROCESSING "BANDS=1,2,3"<br>
<br>
and it <b>crashed</b>. Turning on debugging showed:<br>
<br>
<tt>msLoadMap(): 0.000s</tt><tt><br>
</tt><tt>msDrawMap(): rendering using outputformat named png24
(AGG/PNG).</tt><tt><br>
</tt><tt>msDrawMap(): WMS/WFS set-up and query, 0.000s</tt><tt><br>
</tt><tt>msDrawRasterLayerLow(classified): entering.</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): Entering transform.</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): src=0,0,5300,5430,
dst=107,0,585,599</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): source raster PL (-6.077,-4.533)
for dst PL (107,0).</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): red,green,blue,alpha bands = <b>1,2,3,0</b></tt><tt><br>
</tt><tt>drawGDAL(): Unable to access file. Attempt to classify
24bit image, this is unsupported.</tt><tt><br>
</tt><tt>msDrawMap(): Image handling error. Failed to draw layer
named 'classified'.</tt><br>
<<b>crash</b>><br>
<br>
Without the PROCESSING directive, I get:<br>
<br>
<tt>msLoadMap(): 0.000s</tt><tt><br>
</tt><tt>msDrawMap(): rendering using outputformat named png24
(AGG/PNG).</tt><tt><br>
</tt><tt>msDrawMap(): WMS/WFS set-up and query, 0.000s</tt><tt><br>
</tt><tt>msDrawRasterLayerLow(classified): entering.</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): Entering transform.</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): src=0,0,5300,5430,
dst=107,0,585,599</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): source raster PL (-6.077,-4.533)
for dst PL (107,0).</tt><tt><br>
</tt><tt>msDrawRasterLayerGDAL(): red,green,blue,alpha bands = <b>1,0,0,0</b></tt><tt><br>
</tt><tt>msDrawMap(): Layer 0 (classified), 0.187s</tt><tt><br>
</tt><tt>msDrawMap(): Drawing Label Cache, 0.000s</tt><tt><br>
</tt><tt>msDrawMap() total time: 0.187s</tt><tt><br>
</tt><tt>msSaveImage(test.png) total time: 0.125s</tt><tt><br>
</tt><tt>msFreeMap(): freeing map at 00BBC4A8.</tt><tt><br>
</tt><tt>freeLayer(): freeing layer at 00BBF9B0.</tt><tt><br>
</tt><tt>shp2img total time: 0.312s</tt><br>
<br>
The line<br>
<tt> msDrawRasterLayerGDAL(): red,green,blue,alpha bands = <b>1,0,0,0</b></tt><tt><br>
</tt>implies that GDAL may be using only band one to do the
classification, but maybe not (more testing required?).<br>
<br>
Removing the EXPRESSION object shows<br>
<tt> msDrawRasterLayerGDAL(): red,green,blue,alpha bands =
1,2,3,0</tt><br>
And I do get a 24 bit image for output (as expected).<br>
<br>
<br>
<br>
FYI, here's my mapfile:<br>
<tt><br>
</tt><tt>MAP</tt><tt><br>
</tt><tt> NAME 'classified'</tt><tt><br>
</tt><tt> STATUS ON</tt><tt><br>
</tt><tt> EXTENT -5009377.086 10752549.183 392.653 15885200.067</tt><tt><br>
</tt><tt> SIZE 800 600</tt><tt><br>
</tt><tt><br>
</tt><tt> IMAGETYPE "png24"</tt><tt><br>
</tt><tt> OUTPUTFORMAT # Parameter Output</tt><tt><br>
</tt><tt> NAME png24</tt><tt><br>
</tt><tt> DRIVER "AGG/PNG"</tt><tt><br>
</tt><tt> MIMETYPE "image/png"</tt><tt><br>
</tt><tt> EXTENSION PNG</tt><tt><br>
</tt><tt> IMAGEMODE RGBA</tt><tt><br>
</tt><tt> TRANSPARENT ON</tt><tt><br>
</tt><tt> END # end of parameter Output</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> LAYER NAME "classified"</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> DATA "Arctic_terra.250m.tif"</tt><tt><br>
</tt><tt> DEBUG 5</tt><tt><br>
</tt><tt> TYPE raster</tt><tt><br>
</tt><tt> STATUS default</tt><tt><br>
</tt><tt># PROCESSING "NODATA=0"</tt><tt><br>
</tt><tt># PROCESSING "SCALE=AUTO"</tt><tt><br>
</tt><tt># PROCESSING "BANDS=1,2,3"</tt><tt><br>
</tt><tt># PROCESSING "DITHER=YES" </tt><tt><br>
</tt><tt> CLASS NAME "test"</tt><tt><br>
</tt><tt># EXPRESSION ([pixel] > 100 AND [pixel] <
250)</tt><tt><br>
</tt><tt> EXPRESSION ([red] > 100 AND [green] > 100
AND [blue] > 100)</tt><tt><br>
</tt><tt> STYLE</tt><tt><br>
</tt><tt> COLOR 0 255 0</tt><tt><br>
</tt><tt> END #Style</tt><tt><br>
</tt><tt> END # Class</tt><tt><br>
</tt><tt> END # Layer</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt>END # Map</tt><br>
<br>
<br>
<pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
On 12/5/2012 2:27 AM, Rahkonen Jukka wrote:<br>
</div>
<blockquote
cite="mid:84446DEF76453C439E9E97E438E13A637BF33B@suutari.haapa.mmm.fi"
type="cite">
<pre wrap="">Hi,
You should try to give more exact description about your problem. By reading several mails which you have sent to MS4W list I believe that you are still talking about the same images. That is 3-band, 8 bits per band images stored into database as PostGIS raster and which you have tried to classify into classes with something like this
CLASS # beginning of the class parameter
NAME "Very Low"
EXPRESSION ([pixel] > 0 AND [pixel] < 47)
STYLE
COLOR 243 231 172
END # end style for class
END # end class for class very Low
I had a try with some png file I found from my machine by using this in the mapfile
LAYER
NAME "classified"
DATA "C:\ms4w\apps\data\8000000.png"
debug 10
TYPE RASTER
STATUS ON
PROJECTION
"init=epsg:3067"
END
CLASS
NAME "test"
EXPRESSION ([pixel] > 100 AND [pixel] < 250)
# EXPRESSION ([red] > 100 AND [green] > 100 AND [blue] > 100)
STYLE
COLOR 0 255 0
END
END
END
Both expressions work so Mapserver does support classification of 3-band, 8 bits per band png images.
Try you to convert your raster from the database into image file and repeat your test. It if works from a file but not from PostGIS raster then you know that the issue is somewhere in PostGIS raster handling.
-Jukka Rahkonen-
</pre>
<blockquote type="cite">
<pre wrap="">-----Alkuperäinen viesti-----
Lähettäjä: <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [<a class="moz-txt-link-freetext" href="mailto:mapserver">mailto:mapserver</a>-
<a class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.osgeo.org">users-bounces@lists.osgeo.org</a>] Puolesta Lime, Steve D (DNR)
Lähetetty: 4. joulukuuta 2012 21:26
Vastaanottaja: Saint; <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
Aihe: Re: [mapserver-users] MapServer and 24bit Images
I display true-color imagery all the time. I suspect that's not what you're
trying to do though. You'll have to be more specific on format, perhaps post a
layer definition?
Steve
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [<a class="moz-txt-link-freetext" href="mailto:mapserver-users">mailto:mapserver-users</a>-
<a class="moz-txt-link-abbreviated" href="mailto:bounces@lists.osgeo.org">bounces@lists.osgeo.org</a>] On Behalf Of Saint
Sent: Monday, December 03, 2012 10:06 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
Subject: [mapserver-users] MapServer and 24bit Images
Dear all,
I would like to have this confirmation, MapServer support 24bit image with 3
bands? I have one 24bit image 1 band and I can see in the browser but the
other with 3 bands I can't. Only appear the the outline line of the class e not
the image.
Many thanks
José Santos
-----
José Santos
GIS Analyst
--
View this message in context: <a class="moz-txt-link-freetext" href="http://osgeo">http://osgeo</a>-
org.1560.n6.nabble.com/MapServer-and-24bit-Images-tp5020409.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
</pre>
</blockquote>
<br>
</body>
</html>