<html><head><style type="text/css">body { font-family:'DejaVu Sans Mono'; font-size:12px}</style><meta http-equiv="Content-Type" content="text/html charset=utf-8" /><meta http-equiv="Content-Type" content="text/html charset=utf-8" /></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I've converted road polylines to polygons before by buffering.  You may have to do different road grades/widths in several stages.  <br><br><div class="gmail_quote">On 31 July 2015 05:39:15 BST, qgis-user-request@lists.osgeo.org wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Send Qgis-user mailing list submissions to<br /> qgis-user@lists.osgeo.org<br /><br />To subscribe or unsubscribe via the World Wide Web, visit<br /> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />or, via email, send a message with subject or body 'help' to<br /> qgis-user-request@lists.osgeo.org<br /><br />You can reach the person managing the list at<br /> qgis-user-owner@lists.osgeo.org<br /><br />When replying, please edit your Subject line so it is more specific<br />than "Re: Contents of Qgis-user digest..."<br /></pre><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre class="k9mail">Today's Topics:<br /><br />   1. Layer question (Shane)<br />   2. Re: Layer question (Tom Lennon)<br />   3. Re: Layer question (Bernd Vogelgesang)<br />   4. Re: Layer question (Nicolas Cadieux)<br />   5. Re: How to convert raster routes into vector format?<br />      (Nick Papadonis)<br />   6. Raster Calculator Expression to determine color (Nick Papadonis)<br />   7. Re: Raster Calculator Expression to determine color (Nyall Dawson)<br />   8. Re: Raster Calculator Expression to determine color<br />      (Nick Papadonis)<br />   9. Re: Raster Calculator Expression to determine color<br />      (Nick Papadonis)<br />  10. Re: Raster Calculator bug? (Nick Papadonis)<br /></pre><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Shane <shaned173 gmail.com="gmail.com"></shaned173></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Thu Jul 30 20:05:09 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>[Qgis-user] Layer question</td></tr></tbody></table><pre class="k9mail">   Hi group,<br /><br />    I have a layer with roads which are lines having a style of gray <br />with thin black outlines on either side.  Another layer (parking lots) <br />has polygons having the same color as the roads but not outlined.  The <br />parking lot layer is above the road layer in rendering order.  So road <br />outlines are hidden by the parking lot layer when a parking lot <br />intersects a road.<br /><br />    Here's the trouble - having parking lots with no outline, but roads <br />with outlines looks odd.  Is there some way to have the outlines of both <br />road and parking lot layers removed from rendering when these two <br />features cross?<br /><br />    One method I've considered is to draw the roads and parking lots as <br />polygons in the same layer?  It would make drawing the roads <br />non-trivial, but the problem with outlines would be eliminated.<br /><br />    Shane<br /><br /><br /></pre><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Tom Lennon <tolennon gmail.com="gmail.com"></tolennon></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>Shane <shaned173 gmail.com="gmail.com"></shaned173></td></tr><tr><th style="text-align: left; vertical-align: top;">Cc:</th><td>qgis-user <qgis-user lists.osgeo.org="lists.osgeo.org"></qgis-user></td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Thu Jul 30 22:11:17 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] Layer question</td></tr></tbody></table><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Shane:</div><div class="gmail_default" style="font-size:small">Have you tried moving the parking lot layer to below the road layer?</div><div class="gmail_default" style="font-size:small">That way roads over parking lots would always show.</div><div class="gmail_default" style="font-size:small"><br /></div><div class="gmail_default" style="font-size:small">Tom</div></div><div class="gmail_extra"><br /><div class="gmail_quote">On Thu, Jul 30, 2015 at 3:05 PM, Shane <span dir="ltr"><<a href="mailto:shaned173@gmail.com" target="_blank">shaned173@gmail.com</a>></span> wrote:<br /><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  Hi group,<br />
<br />
   I have a layer with roads which are lines having a style of gray with thin black outlines on either side.  Another layer (parking lots) has polygons having the same color as the roads but not outlined.  The parking lot layer is above the road layer in rendering order.  So road outlines are hidden by the parking lot layer when a parking lot intersects a road.<br />
<br />
   Here's the trouble - having parking lots with no outline, but roads with outlines looks odd.  Is there some way to have the outlines of both road and parking lot layers removed from rendering when these two features cross?<br />
<br />
   One method I've considered is to draw the roads and parking lots as polygons in the same layer?  It would make drawing the roads non-trivial, but the problem with outlines would be eliminated.<br />
<br />
   Shane<br />
<br />
_______________________________________________<br />
Qgis-user mailing list<br />
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br />
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />
</blockquote></div><br /><br clear="all" /><div><br /></div>-- <br /><div class="gmail_signature"><a href="mailto:tolennon@gmail.com" target="_blank">tolennon@gmail.com</a></div>
</div>
<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Bernd Vogelgesang <bernd.vogelgesang gmx.de="gmx.de"></bernd.vogelgesang></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Thu Jul 30 22:50:36 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] Layer question</td></tr></tbody></table>


<div>Hi Shane,</div><div>I think without a screenshot, we have no chance to really get an idea what it's all about.</div><div>Best to use a service like http://imgur.com/ and post the link cause the list will bounce too heavy attachments.</div><div><br /></div><div>Bernd</div><div><br /></div><div><br /></div><div><br /></div><div>Am 30.07.2015, 23:11 Uhr, schrieb Tom Lennon <tolennon@gmail.com>:<br /></div><br /><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Shane:</div><div class="gmail_default" style="font-size:small">Have you tried moving the parking lot layer to below the road layer?</div><div class="gmail_default" style="font-size:small">That way roads over parking lots would always show.</div><div class="gmail_default" style="font-size:small"><br /></div><div class="gmail_default" style="font-size:small">Tom</div></div><div class="gmail_extra"><br /><div class="gmail_quote">On Thu, Jul 30, 2015 at 3:05 PM, Shane <span dir="ltr"><<a href="mailto:shaned173@gmail.com" target="_blank">shaned173@gmail.com</a>></span> wrote:<br /><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  Hi group,<br />
<br />
   I have a layer with roads which are lines having a style of gray with thin black outlines on either side.  Another layer (parking lots) has polygons having the same color as the roads but not outlined.  The parking lot layer is above the road layer in rendering order.  So road outlines are hidden by the parking lot layer when a parking lot intersects a road.<br />
<br />
   Here's the trouble - having parking lots with no outline, but roads with outlines looks odd.  Is there some way to have the outlines of both road and parking lot layers removed from rendering when these two features cross?<br />
<br />
   One method I've considered is to draw the roads and parking lots as polygons in the same layer?  It would make drawing the roads non-trivial, but the problem with outlines would be eliminated.<br />
<br />
   Shane<br />
<br />
_______________________________________________<br />
Qgis-user mailing list<br />
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br />
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />
</blockquote></div><br /><br clear="all" /><div><br /></div>-- <br /><div class="gmail_signature"><a href="mailto:tolennon@gmail.com" target="_blank">tolennon@gmail.com</a></div>
</div>
</blockquote><br /><br /><br /><div id="M2Signature"><div>-- </div><div>Bernd Vogelgesang<br />Siedlerstraße 2<br />91083 Baiersdorf/Igelsdorf<br />Tel: 09133-825374</div></div><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Nicolas Cadieux <nicolas.cadieux archeotec.ca="archeotec.ca"></nicolas.cadieux></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Thu Jul 30 23:07:50 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] Layer question</td></tr></tbody></table><p dir="ltr">Hi,</p>
<p dir="ltr">You can play with the layer blending.  You can use "multiply" , "add", "subtract"...  (something like that, I am not in front of a computer).  There are also the same blending options in the vector object styling so that you can select what happens when two objects intersect in the same layer.</p>
<p dir="ltr">Maybe that could help?</p>
<p dir="ltr">Nicolas Cadieux M.Sc.<br />
Les Entreprises Archéotec inc. <br />
8548, rue Saint-Denis Montréal H2P 2H2<br />
Téléphone: 514.381.5112  Fax: 514.381.4995<br />
www.archeotec.ca</p>
<div class="gmail_quote">On Jul 30, 2015 5:45 PM, "berndv. [via OSGeo.org]" <<a href="/user/SendEmail.jtp?type=node&node=5217890&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:<br type="attribution" /><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" class="quote">

 


<div>Hi Shane,</div><div>I think without a screenshot, we have no chance to really get an idea what it's all about.</div><div>Best to use a service like http://imgur.com/ and post the link cause the list will bounce too heavy attachments.</div><div><br /></div><div>Bernd</div><div><br /></div><div><br /></div><div><br /></div><div>Am 30.07.2015, 23:11 Uhr, schrieb Tom Lennon <<a href="/user/SendEmail.jtp?type&#61;node&amp;node&#61;5217887&amp;i&#61;0">[hidden email]>:<br /></div><br /><div dir="ltr"><div style="font-size:small">Hi Shane:</div><div style="font-size:small">Have you tried moving the parking lot layer to below the road layer?</div><div style="font-size:small">That way roads over parking lots would always show.</div><div style="font-size:small"><br /></div><div style="font-size:small">Tom</div></div><div><br /><div class="elided-text">On Thu, Jul 30, 2015 at 3:05 PM, Shane <span dir="ltr"><<a href="/user/SendEmail.jtp?type&#61;node&amp;node&#61;5217887&amp;i&#61;1">[hidden email]></span> wrote:<br />  Hi group,<br />
<br />
   I have a layer with roads which are lines having a style of gray with thin black outlines on either side.  Another layer (parking lots) has polygons having the same color as the roads but not outlined.  The parking lot layer is above the road layer in rendering order.  So road outlines are hidden by the parking lot layer when a parking lot intersects a road.<br />
<br />
   Here's the trouble - having parking lots with no outline, but roads with outlines looks odd.  Is there some way to have the outlines of both road and parking lot layers removed from rendering when these two features cross?<br />
<br />
   One method I've considered is to draw the roads and parking lots as polygons in the same layer?  It would make drawing the roads non-trivial, but the problem with outlines would be eliminated.<br />
<br />
   Shane<br />
<br />
_______________________________________________<br />
Qgis-user mailing list<br />
<a href="/user/SendEmail.jtp?type&#61;node&amp;node&#61;5217887&amp;i&#61;2">[hidden email]<br />
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_top" rel="nofollow" link="external">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />
</div></div></blockquote></div><br /><br clear="all" /><div><br /></div>-- <br /><div><a href="/user/SendEmail.jtp?type&#61;node&amp;node&#61;5217887&amp;i&#61;3">[hidden email]</div>

<br /><br /><br /><div><div>-- </div><div>Bernd Vogelgesang<br />Siedlerstraße 2<br />91083 Baiersdorf/Igelsdorf<br />Tel: 09133-825374</div></div><br />_______________________________________________
<br />Qgis-user mailing list
<br /><a href="/user/SendEmail.jtp?type&#61;node&amp;node&#61;5217887&amp;i&#61;4">[hidden email]
<br /><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_top" rel="nofollow" link="external">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>

 
 
 
 <br />
 <br />
 <hr noshade="noshade" size="1" />
 <div style="color:#444;font:12px 'tahoma' , 'geneva' , 'helvetica' , 'arial' , sans-serif">
  <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
  <a href="http://osgeo-org.1560.x6.nabble.com/Layer-question-tp5217849p5217887.html" target="_top" rel="nofollow" link="external">http://osgeo-org.1560.x6.nabble.com/Layer-question-tp5217849p5217887.html</a>
 </div>
 <div style="color:#666;font:11px 'tahoma' , 'geneva' , 'helvetica' , 'arial' , sans-serif;margin-top:0.4em;line-height:1.5em">
  To start a new topic under Quantum GIS - User, email ml-node+s1560n4125267h38@n6.nabble.com <br />
  To unsubscribe from Quantum GIS - User, <a href="http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro&#61;unsubscribe_by_code&amp;node&#61;4125267&amp;code&#61;bmljb2xhcy5jYWRpZXV4QGFyY2hlb3RlYy5jYXw0MTI1MjY3fDYzNDQ4MjQxNg&#61;&#61;">click here.<br />
  <a href="http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro&#61;macro_viewer&amp;id&#61;instant_html%21nabble%3Aemail.naml&amp;base&#61;nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs&#61;notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" style="font:9px serif">NAML
 </div>

 
 
 
<br /><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Layer-question-tp5217849p5217890.html">Re: Layer question</a><br />
Sent from the <a href="http://osgeo-org.1560.x6.nabble.com/Quantum-GIS-User-f4125267.html">Quantum GIS - User mailing list archive</a> at Nabble.com.<br /><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Nick Papadonis <npapadonis gmail.com="gmail.com"></npapadonis></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>"Håvard Tveite" <havard.tveite nmbu.no="nmbu.no"></havard.tveite></td></tr><tr><th style="text-align: left; vertical-align: top;">Cc:</th><td>qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Fri Jul 31 00:45:56 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] How to convert raster routes into vector format?</td></tr></tbody></table><pre class="k9mail">Hi Havard,<br /><br />Unfortunately, the expression below results in a complete black TIFF.  I am referencing the correct layer.  Any ideas?<br /><br />Thanks<br />Nick<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> On Jul 29, 2015, at 4:34 PM, Håvard Tveite <havard.tveite@nmbu.no> wrote:<br /> <br /> With QGIS 2.10, the following should work (probably also OK<br /> for earlier versions).<br /> <br /> Check the band values of your colour using the info button,<br /> and use the values in the expression below (assuming the<br /> name of your raster layer is yourraster) instead of 116, 20<br /> and 31:<br /> <br /> ("yourraster@1" = 116  AND "yourraster@2" =  20 AND "yourraster@3" = 31) * 1<br /> <br /> This should give you a binary raster with 1 in the pixels<br /> that have your colour and 0 in the pixels with other colours.<br /> <br /> In the style dialogue you can use the following to see the<br /> resulting binary image:<br /> Colour gradient: "white to black"<br /> Min: 0<br /> Max: 1<br /> <br /> You should be able to use r.thin on that image, but I am not<br /> able to test this now, as I am on Ubuntu, and have not been<br /> able to get GRASS to work through Processing on that platform<br /> for QGIS 2.10.<br /> <br /> Håvard<br /> <br /> On 29. juli 2015 16:40, Nick Papadonis wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Hi Håvard,<br /> <br /> I found the raster calculator and read the online manual for it, however am still a bit lost.  I was also playing with the Style properties and color bands last night to try to accomplish this.  I was unable to get a single binary image with the single color (red in this case).  I think the understand the r.thin suggestion and that it will thin the single color thick lines for vectorization.  Appreciate if you can expand on obtaining a binary skeleton of the one color of the trails.<br /> <br /> Thanks again,<br /> Nick<br /> <br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> On Jul 29, 2015, at 7:18 AM, Havard Tveite <havard.tveite@nmbu.no> wrote:<br /> <br /> If you are going to use GRASS <a href="http://r.to">r.to</a>.vect (for instance through QGIS<br /> Processing), you will need a binary skeleton image.<br /> You could get one by using the raster calculator to extract<br /> your single colour as a binary image, and then GRASS r.thin<br /> (available in QGIS Processing) to get the skeleton.<br /> <br /> Håvard<br /> <br /> On 29/7/2015 8:36:AM, Nick Papadonis wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;"> Hi Folks,<br /> <br /> I have a map with numerous trails in a single color and would like to vectorize these.  Is there a mode Qgis can be placed in such that a color can be selected for inclusion in the vectorization process?  I.e. to make converting these routes to vector format easier?<br /> <br /> Thanks again<br /><hr /><br /> Qgis-user mailing list<br /> Qgis-user@lists.osgeo.org<br /> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> <br /></blockquote></blockquote> <br /></blockquote></blockquote><br /><br /></pre><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Nick Papadonis <npapadonis gmail.com="gmail.com"></npapadonis></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>Qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Fri Jul 31 02:07:44 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>[Qgis-user] Raster Calculator Expression to determine color</td></tr></tbody></table><pre class="k9mail">HI Folks,<br /><br />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. <br /><br />(“m@1" < 238 AND “m@1" > 213 AND “m@2" < 123 AND “m@2" > 98 AND “m@3" < 125 AND “m@3" < 99) * 1<br /><br />Unfortunately, when this expression is used the resulting map is black with no other pixels for the detected color.<br /><br />If I break down this expression to a simple “greater than” line for single band, then things work.<br /><br />Does anyone know where this expression needs to be corrected?<br /><br />Thanks again,<br />Nick<br /></pre><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Nyall Dawson <nyall.dawson gmail.com="gmail.com"></nyall.dawson></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>Nick Papadonis <npapadonis gmail.com="gmail.com"></npapadonis></td></tr><tr><th style="text-align: left; vertical-align: top;">Cc:</th><td>Qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Fri Jul 31 02:29:34 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] Raster Calculator Expression to determine color</td></tr></tbody></table><p dir="ltr"><br />
On 31 Jul 2015 11:07 am, "Nick Papadonis" <<a href="mailto:npapadonis@gmail.com">npapadonis@gmail.com</a>> wrote:<br />
><br />
> HI Folks,<br />
><br />
> 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.<br />
><br />
> (“m@1" < 238 AND “m@1" > 213 AND “m@2" < 123 AND “m@2" > 98 AND “m@3" < 125 AND “m@3" < 99) * 1</p>
<p dir="ltr">Should that last check be "m@3" > 99?</p>
<p dir="ltr">Nyall</p>
<p dir="ltr">><br />
> Unfortunately, when this expression is used the resulting map is black with no other pixels for the detected color.<br />
><br />
> If I break down this expression to a simple “greater than” line for single band, then things work.<br />
><br />
> Does anyone know where this expression needs to be corrected?<br />
><br />
> Thanks again,<br />
> Nick<br />
> _______________________________________________<br />
> Qgis-user mailing list<br />
> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br />
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></p>
<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Nick Papadonis <npapadonis gmail.com="gmail.com"></npapadonis></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>Nyall Dawson <nyall.dawson gmail.com="gmail.com"></nyall.dawson></td></tr><tr><th style="text-align: left; vertical-align: top;">Cc:</th><td>Qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Fri Jul 31 02:30:44 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] Raster Calculator Expression to determine color</td></tr></tbody></table><br class="" /><div><blockquote type="cite" class=""><div class="">On Jul 30, 2015, at 9:29 PM, Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com" class="">nyall.dawson@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline" /><div class=""><p dir="ltr" class=""><br class="" />
On 31 Jul 2015 11:07 am, "Nick Papadonis" <<a href="mailto:npapadonis@gmail.com" class="">npapadonis@gmail.com</a>> wrote:<br class="" />
><br class="" />
> HI Folks,<br class="" />
><br class="" />
> 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.<br class="" />
><br class="" />
> (“m@1" < 238 AND “m@1" > 213 AND “m@2" < 123 AND “m@2" > 98 AND “m@3" < 125 AND “m@3" < 99) * 1</p><p dir="ltr" class="">Should that last check be "m@3" > 99?</p><div class=""><br class="" /></div></div></blockquote>Yeah, I changed that and still same results.  If I specify on > and remove the < expressions, then everything works.  Very odd considering the color is within the range above (with the line you referenced fixed).</div><div><br class="" /></div><div>Thanks<br class="" /><blockquote type="cite" class=""><div class=""><p dir="ltr" class="">Nyall</p><p dir="ltr" class="">><br class="" />
> Unfortunately, when this expression is used the resulting map is black with no other pixels for the detected color.<br class="" />
><br class="" />
> If I break down this expression to a simple “greater than” line for single band, then things work.<br class="" />
><br class="" />
> Does anyone know where this expression needs to be corrected?<br class="" />
><br class="" />
> Thanks again,<br class="" />
> Nick<br class="" />
> _______________________________________________<br class="" />
> Qgis-user mailing list<br class="" />
> <a href="mailto:Qgis-user@lists.osgeo.org" class="">Qgis-user@lists.osgeo.org</a><br class="" />
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" class="">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></p>
</div></blockquote></div><br class="" /><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Nick Papadonis <npapadonis gmail.com="gmail.com"></npapadonis></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>Nyall Dawson <nyall.dawson gmail.com="gmail.com">, Qgis-user@lists.osgeo.org</nyall.dawson></td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Fri Jul 31 02:56:24 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] Raster Calculator Expression to determine color</td></tr></tbody></table><br class="" /><div><blockquote type="cite" class=""><div class="">On Jul 30, 2015, at 9:29 PM, Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com" class="">nyall.dawson@gmail.com</a>> wrote:</div><div class=""><p dir="ltr" class="">On 31 Jul 2015 11:07 am, "Nick Papadonis" <<a href="mailto:npapadonis@gmail.com" class="">npapadonis@gmail.com</a>> wrote:<br class="" />
><br class="" />
> HI Folks,<br class="" />
><br class="" />
> 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.<br class="" />
><br class="" />
> (“m@1" < 238 AND “m@1" > 213 AND “m@2" < 123 AND “m@2" > 98 AND “m@3" < 125 AND “m@3" < 99) * 1</p><p dir="ltr" class="">Should that last check be "m@3" > 99?</p><div class=""><br class="" /></div></div></blockquote><div><br class="" /></div><div>I corrected above to:</div><div>(“m@1" < 238 AND “m@1" > 213 AND “m@2" < 123 AND “m@2" > 98 AND “m@3" < 125 AND “m@3” > 99) * 1</div><div><br class="" /></div><div>with the same results which is black output tiff.</div><div><br class="" /></div><div>I then tried individual expressions for each band as separate steps (sanity check):</div><div>(“m@1" < 238 AND “m@1" > 213) * 1</div><div>(“m@2" < 123 AND “m@2" > 98) * 1</div><div>(“m@3" < 125 AND “m@3” > 99) * 1</div><div><br class="" /></div><div>These all produce a masked image, however masked incorrectly because I’m evaluating only a single band in the Raster Calculator.</div><div><br class="" /></div><div>When I combine evaluation of bands as above or below to pick pixels in color range:</div><div><br class="" /></div> ((“m@1" < 238 AND “m@1" > 210) AND (“m@2" < 123 AND “m@2" > 94) AND (“m@3" < 130 AND “m@3" > 98)) * 1</div><div><br class="" /></div><div>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.</div><div><br class="" /></div><div>Does anyone know if my expression needs correction or the Raster Calculator can only evaluate a single band in the expression?</div><div><br class="" /></div><div>Thanks again,</div><div>Nick</div><div><br class="" /><blockquote type="cite" class=""><div class=""><p dir="ltr" class="">Nyall</p><p dir="ltr" class="">><br class="" />
> Unfortunately, when this expression is used the resulting map is black with no other pixels for the detected color.<br class="" />
><br class="" />
> If I break down this expression to a simple “greater than” line for single band, then things work.<br class="" />
><br class="" />
> Does anyone know where this expression needs to be corrected?<br class="" />
><br class="" />
> Thanks again,<br class="" />
> Nick<br class="" />
> _______________________________________________<br class="" />
> Qgis-user mailing list<br class="" />
> <a href="mailto:Qgis-user@lists.osgeo.org" class="">Qgis-user@lists.osgeo.org</a><br class="" />
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" class="">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></p>
</div></blockquote></div><br class="" /><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><table style="border: 0"><tbody><tr><th style="text-align: left; vertical-align: top;">From:</th><td>Nick Papadonis <npapadonis gmail.com="gmail.com"></npapadonis></td></tr><tr><th style="text-align: left; vertical-align: top;">To:</th><td>Qgis-user@lists.osgeo.org</td></tr><tr><th style="text-align: left; vertical-align: top;">Sent:</th><td>Fri Jul 31 05:39:12 BST 2015</td></tr><tr><th style="text-align: left; vertical-align: top;">Subject:</th><td>Re: [Qgis-user] Raster Calculator bug?</td></tr></tbody></table><pre class="k9mail">Folks,<br /><br />I’m using QGIS 10.1.  The following expressions result in a black raster of 0’s, when I expected only red pixels to appears in the binary image indicating routes on a map:<br /><br />a) (“m@1" < 238 AND “m@1" > 213 AND “m@2" < 123 AND “m@2" > 98 AND “m@3" < 125 AND “m@3” > 99) * 1<br />b) ((“m@1" < 238 AND “m@1" > 210) * 1) * ((“m@2" < 123 AND “m@2" > 94) * 1) * ((“m@3" < 130 AND “m@3" > 98) * 1)<br /><br />I then tried the following individual expressions for each band as separate steps (sanity check) and they work to cover the pixels in range:<br />c) (“m@1" < 238 AND “m@1" > 213) * 1<br />d) (“m@2" < 123 AND “m@2" > 98) * 1<br />e) (“m@3" < 125 AND “m@3” > 99) * 1<br /><br />I then tried the following expression which appears to create a proper greyscale image focusing on the red pixels.  I replaced the multiplication with addition to see what was happening:<br />f) ((“m@1" < 238 AND “m@1" > 210) * 1) + ((“m@2" < 123 AND “m@2" > 94) * 1) + ((“m@3" < 130 AND “m@3" > 98) * 1)<br /><br />The resulting raster has a Min = 0 and Max = 1.998.  I was expecting it to be Min = 0 and Max = 3.  The value of 3 would indicate all 3 bands were positive on color match.  I then go to the layer properties and load calculate min/max again and it is Min = 0 and Max = 3.  I tried to change the min/max settings on they layer and these settings will not stay set.  The layer goes back to Max = 1.998.  What’s even more odd is the max being a floating point number.  I suspect that may be part of the issue.  Anyone know why this is the case for integer band values?  Has anyone successfully used the Raster Calculator to perform this sort of work before?<br /><br />Thanks again,<br />Nick<br /></pre><p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre class="k9mail"><hr /><br />Qgis-user mailing list<br />Qgis-user@lists.osgeo.org<br /><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre></blockquote></div><br>
--<br>
Jonathan Webb <br>
Freelance GIS specialist<br>
07941 921905<br>
<a href="http://www.jwebbgis.co.uk">www.jwebbgis.co.uk</a><br>
</body></html>