[MS4W-Users] Image 24 Bit

Brent Fraser bfraser at geoanalytic.com
Fri Nov 23 11:44:47 EST 2012


This is the MS4W list so you may want to ask your question on the 
Mapserver users list.

I'd experiment with removing some of the PROCESSING directives. Take out 
the DITHER one, it's not useful with the input and output are 24-bit 
images.  And I'd consider removing the SCALE=AUTO,; it may be messing 
with your input data and cause the CLASS EXPRESSIONS to not be useful.

And I see that your EXPRESSIONS are operating on [PIXEL] which is fine 
for one band input images, but invalid for 3 band images (use 
[RED],[GREEN], and [BLUE] for 3-band images).

Best Regards,
Brent Fraser

On 11/23/2012 9:28 AM, José Pedro Santos wrote:
> Hi Brent,
>
> Thanks for the reply. Im no using MS4W. In working on Linux and using 
> the version 6.2.0
>
> My mapfile layer is like this:
>
> LAYER # beginning of the layer parameter
>  NAME "fapartest"
>  TYPE RASTER
>  STATUS ON
>  DATA "PG:host=localhost port=5432 dbname='Environment_Models' 
> user='postgres' password='postgres' schema='public' 
> table='africarastercerto' mode='2'"
>  PROCESSING "NODATA=0"
>  PROCESSING "SCALE=AUTO"
>  PROCESSING "BANDS=1,2,3"
>  PROCESSING "DITHER=YES"
>
> CLASS # beginning of the class parameter
>  NAME "Null"
>  EXPRESSION "0"
>  STYLE
>  COLOR 255 255 255
> END # end style for class Null
> END # end class for class Null
>
> 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
>
> CLASS # beginning of the class parameter
>  NAME "Low"
>  EXPRESSION ([pixel] > 47 AND [pixel] < 85)
>  STYLE
>   COLOR 132 205 51
> END # end style for class
> END # end class for class Low
>
> CLASS # beginning of the class parameter
>  NAME "Moderate"
>  EXPRESSION ([pixel] > 85 AND [pixel] < 100)
>  STYLE
>   COLOR 95 202 31
> END # end style for class
> END # end class for class Moderate
>
> CLASS # beginning of the class parameter
>  NAME "High"
>  EXPRESSION ([pixel] > 100 AND [pixel] < 125)
>  STYLE
>   COLOR 2 180 0
> END # end style for class
> END # end class for class high
> CLASS # beginning of the class parameter
>  NAME "Vey High"
>  EXPRESSION ([pixel] > 125 AND [pixel] < 255)
>
>
> I did the same to another raster file and works (only 1 band). This 
> have 3 bands and when I change the parameter PROCESSING "BANDS=1,2,3" 
> to  PROCESSING "BANDS=1,2" I have result but is a blank image.
>
> Best Regards,
> José Santos
>
>
> ------------------------------------------------------------------------
> Date: Fri, 23 Nov 2012 09:02:37 -0700
> From: bfraser at geoanalytic.com
> To: zpsantos1 at hotmail.com
> CC: ms4w-users at lists.maptools.org
> Subject: Re: [MS4W-Users] Image 24 Bit
>
> Which version of Mapserver (or MS4W) are you using?
>
> I think this error has to do with processing the input imagery in your 
> LAYER, not the generation of the output image.
> How are you trying to classify your input data?  What does your LAYER 
> object definition look like in your map file?
> Best Regards,
> Brent Fraser
> On 11/23/2012 8:33 AM, José Pedro Santos wrote:
>
>
>
>     > Date: Fri, 23 Nov 2012 09:59:43 -0400
>     > From: jmckenna at gatewaygeomatics.com
>     <mailto:jmckenna at gatewaygeomatics.com>
>     > To: ms4w-users at lists.maptools.org
>     <mailto:ms4w-users at lists.maptools.org>
>     > Subject: Re: [MS4W-Users] Image 24 Bit
>     >
>     > On 12-11-23 9:27 AM, José Pedro Santos wrote:
>     > > Dear all,
>     > >
>     > > I'm attempting to classify images of 24 bits but I always have
>     the error
>     > > saying this: ........Unable to access file. Attempt to
>     classify 24bit
>     > > image, this is unsupported.
>     > >
>     > > My Mapfile is this one:
>     > >
>     > > ...........
>     > >
>     > > IMAGETYPE "png24"
>     > >
>     > > ..........
>     > >
>     > > OUTPUTFORMAT # Parameter Output
>     > > NAME png24
>     > > DRIVER "GD/PNG"
>     > > MIMETYPE "image/png"
>     > > EXTENSION PNG
>     > > IMAGEMODE RGBA
>     > > TRANSPARENT ON
>     > > END # end of parameter Output
>     > >
>     > >
>     > > and in the expression of GetMap I use FORMAT=image/png
>     > >
>     > > In the Layer description I have the special processing
>     directives to
>     > > processed the 3 bands. But If put just 2 appear one empty
>     image not the
>     > > error. I already read some documentation but I can't succeed.
>     > >
>     > > any idea?
>     > >
>     > > Many thanks and best regards,
>     > >
>     > > José Santos
>     >
>     > Hello José,
>     >
>     > It is difficult for me to comment without testing your local file.
>     > However if I were you I might:
>     >
>     > - in your OUTPUTFORMAT object I would:
>     > - change "GD/PNG" to "AGG/PNG"
>     > - change "RGBA" to "RGB"
>     > - remove "TRANSPARENT ON"
>     >
>     >
>     > -jeff
>     >
>     >
>     >
>     >
>     > --
>     > Jeff McKenna
>     > MapServer Consulting and Training Services
>     > http://www.gatewaygeomatics.com/
>     >
>     >
>     Hi Jeff,
>
>     Thanks again for your reply. I try to change but didn't work. Do
>     you think that have something to do with the Format=image/png??
>     Just PNG don't reply 8 bits images?
>
>     Also I have another raster image but that one works well. This
>     have 3 bands and values between 0 and 255. I'm using MapServer
>     version 6.2.
>
>     Another idea?
>
>     Best Regards,
>     José Santos
>
>
>
>
>
>
>
>
>
>
>
>
>
>     > _______________________________________________
>     > MS4W-Users mailing list
>     > MS4W-Users at lists.maptools.org <mailto:MS4W-Users at lists.maptools.org>
>     > http://lists.maptools.org/mailman/listinfo/ms4w-users
>
>
>     _______________________________________________
>     MS4W-Users mailing list
>     MS4W-Users at lists.maptools.org  <mailto:MS4W-Users at lists.maptools.org>
>     http://lists.maptools.org/mailman/listinfo/ms4w-users
>
>
>
>
> _______________________________________________
> MS4W-Users mailing list
> MS4W-Users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ms4w-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20121123/768dbb9f/attachment-0001.htm 


More information about the MS4W-Users mailing list