[Qgis-user] Raster Calculator Expression to determine color
Nick Papadonis
npapadonis at gmail.com
Thu Jul 30 18:56:24 PDT 2015
> On Jul 30, 2015, at 9:29 PM, Nyall Dawson <nyall.dawson at gmail.com> wrote:
> On 31 Jul 2015 11:07 am, "Nick Papadonis" <npapadonis at gmail.com <mailto:npapadonis at gmail.com>> wrote:
> >
> > HI Folks,
> >
> > I’m trying to use the following expression to pick up the red colored routes on a map in which I used the info pointer tool to get the band values for the color.
> >
> > (“m at 1" < 238 AND “m at 1" > 213 AND “m at 2" < 123 AND “m at 2" > 98 AND “m at 3" < 125 AND “m at 3" < 99) * 1
>
> Should that last check be "m at 3" > 99?
>
>
I corrected above to:
(“m at 1" < 238 AND “m at 1" > 213 AND “m at 2" < 123 AND “m at 2" > 98 AND “m at 3" < 125 AND “m at 3” > 99) * 1
with the same results which is black output tiff.
I then tried individual expressions for each band as separate steps (sanity check):
(“m at 1" < 238 AND “m at 1" > 213) * 1
(“m at 2" < 123 AND “m at 2" > 98) * 1
(“m at 3" < 125 AND “m at 3” > 99) * 1
These all produce a masked image, however masked incorrectly because I’m evaluating only a single band in the Raster Calculator.
When I combine evaluation of bands as above or below to pick pixels in color range:
((“m at 1" < 238 AND “m at 1" > 210) AND (“m at 2" < 123 AND “m at 2" > 94) AND (“m at 3" < 130 AND “m at 3" > 98)) * 1
I get a black image with no matches. I expected at least one pixel identified using this expression because I evaluate a pixel at 224, 108, 115 and there are many other pixels in above range.
Does anyone know if my expression needs correction or the Raster Calculator can only evaluate a single band in the expression?
Thanks again,
Nick
> Nyall
>
> >
> > Unfortunately, when this expression is used the resulting map is black with no other pixels for the detected color.
> >
> > If I break down this expression to a simple “greater than” line for single band, then things work.
> >
> > Does anyone know where this expression needs to be corrected?
> >
> > Thanks again,
> > Nick
> > _______________________________________________
> > Qgis-user mailing list
> > Qgis-user at lists.osgeo.org <mailto:Qgis-user at lists.osgeo.org>
> > http://lists.osgeo.org/mailman/listinfo/qgis-user <http://lists.osgeo.org/mailman/listinfo/qgis-user>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150730/f0d346b3/attachment.html>
More information about the Qgis-user
mailing list