[mapserver-users] CLASS directive

Matt Bartolome mattxbart at gmail.com
Tue Apr 26 18:07:11 EDT 2011


On Tue, Apr 26, 2011 at 11:46 AM, Mark Korver <mwkorver at gmail.com> wrote:

> Maybe you can just define the layer 2X in the mapfile.  Put the
> altered layer on top of the regular layer? I am assuming that you can
> get the good values to be transparent and not white.
>

Thanks Mark! This works great.


> On Tue, Apr 26, 2011 at 11:57 AM, Matt Bartolome <mattxbart at gmail.com>
> wrote:
> > Hello,
> > I have a funky raster I'm trying to tile as jpegs. For whatever reason
> this
> > RGB raster has white pixels on the source raster which should be black.
> Is
> > it possible to set only these white pixels to be black on the output
> jpeg? I
> > was playing around with the CLASS directive. This sets all those white
> > pixels to black, but it does not preserve the rest of the rgb that I want
> to
> > use; those "good" values are not processed and show as blank (white)
> space.
> > How do I do this? I thought of preprocessing this with gdalwarp but the
> > raster becomes too large (source is an ecw) on output so need to do it
> > on-the-fly with mapserver (I'm using mapserver trunk and gdal 1.8 on
> linux).
> >
> > Thanks!
> > Matt
> >
> > OUTPUTFORMAT
> >     NAME jpeg
> >     DRIVER "AGG/JPEG"
> >     MIMETYPE "image/jpeg"
> >     IMAGEMODE RGB
> >     EXTENSION "jpg"
> > END
> >
> > LAYER
> >   NAME "test"
> >   TYPE RASTER
> >   STATUS ON
> >   DATA "/test.tif"
> >
> >   PROJECTION
> >     "init=epsg:2230"
> >   END
> >
> >   PROCESSING "NODATA=255"
> >
> >   CLASS
> >     NAME "set white to black"
> >     EXPRESSION ([red] = 255 AND [green] = 255 AND [blue] = 255)
> >     STYLE
> >     COLOR 0 0 0
> >   END
> >
> > END
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110426/381cb2bf/attachment.html


More information about the mapserver-users mailing list