[Qgis-user] Qgis-user Layer question

Jonathan Webb jonathan at jwebbgis.co.uk
Thu Jul 30 23:44:41 PDT 2015


I've converted road polylines to polygons before by buffering.  You may have to do different road grades/widths in several stages.  

On 31 July 2015 05:39:15 BST, qgis-user-request at lists.osgeo.org wrote:
>Send Qgis-user mailing list submissions to
>	qgis-user at lists.osgeo.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	http://lists.osgeo.org/mailman/listinfo/qgis-user
>or, via email, send a message with subject or body 'help' to
>	qgis-user-request at lists.osgeo.org
>
>You can reach the person managing the list at
>	qgis-user-owner at lists.osgeo.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Qgis-user digest..."
>
>
>------------------------------------------------------------------------
>
>Today's Topics:
>
>   1. Layer question (Shane)
>   2. Re: Layer question (Tom Lennon)
>   3. Re: Layer question (Bernd Vogelgesang)
>   4. Re: Layer question (Nicolas Cadieux)
>   5. Re: How to convert raster routes into vector format?
>      (Nick Papadonis)
>   6. Raster Calculator Expression to determine color (Nick Papadonis)
>  7. Re: Raster Calculator Expression to determine color (Nyall Dawson)
>   8. Re: Raster Calculator Expression to determine color
>      (Nick Papadonis)
>   9. Re: Raster Calculator Expression to determine color
>      (Nick Papadonis)
>  10. Re: Raster Calculator bug? (Nick Papadonis)
>
>
>------------------------------------------------------------------------
>
>From: Shane <shaned173 at gmail.com>
>To: qgis-user at lists.osgeo.org
>Sent: Thu Jul 30 20:05:09 BST 2015
>Subject: [Qgis-user] Layer question
>
>   Hi group,
>
>    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.
>
>   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?
>
>   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.
>
>    Shane
>
>
>
>
>------------------------------------------------------------------------
>
>From: Tom Lennon <tolennon at gmail.com>
>To: Shane <shaned173 at gmail.com>
>Cc: qgis-user <qgis-user at lists.osgeo.org>
>Sent: Thu Jul 30 22:11:17 BST 2015
>Subject: Re: [Qgis-user] Layer question
>
>Hi Shane:
>Have you tried moving the parking lot layer to below the road layer?
>That way roads over parking lots would always show.
>
>Tom
>
>On Thu, Jul 30, 2015 at 3:05 PM, Shane <shaned173 at gmail.com> wrote:
>
>>   Hi group,
>>
>>    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.
>>
>>    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?
>>
>>    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.
>>
>>    Shane
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
>
>-- 
>tolennon at gmail.com
>
>
>------------------------------------------------------------------------
>
>From: Bernd Vogelgesang <bernd.vogelgesang at gmx.de>
>To: qgis-user at lists.osgeo.org
>Sent: Thu Jul 30 22:50:36 BST 2015
>Subject: Re: [Qgis-user] Layer question
>
>Hi Shane,
>I think without a screenshot, we have no chance to really get an idea
>what  
>it's all about.
>Best to use a service like http://imgur.com/ and post the link cause
>the  
>list will bounce too heavy attachments.
>
>Bernd
>
>
>
>Am 30.07.2015, 23:11 Uhr, schrieb Tom Lennon <tolennon at gmail.com>:
>
>> Hi Shane:
>> Have you tried moving the parking lot layer to below the road layer?
>> That way roads over parking lots would always show.
>>
>> Tom
>>
>> On Thu, Jul 30, 2015 at 3:05 PM, Shane <shaned173 at gmail.com> wrote:
>>>  Hi group,
>>>
>>>   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.
>>>
>>>   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?
>>>
>>>   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.
>>>
>>>   Shane
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>> --tolennon at gmail.com
>
>
>
>-- 
>Bernd Vogelgesang
>Siedlerstraße 2
>91083 Baiersdorf/Igelsdorf
>Tel: 09133-825374
>
>------------------------------------------------------------------------
>
>From: Nicolas Cadieux <nicolas.cadieux at archeotec.ca>
>To: qgis-user at lists.osgeo.org
>Sent: Thu Jul 30 23:07:50 BST 2015
>Subject: Re: [Qgis-user] Layer question
>
>Hi, 
>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. 
>Maybe that could help? 
>Nicolas Cadieux M.Sc. 
>Les Entreprises Archéotec inc.  
>8548, rue Saint-Denis Montréal H2P 2H2 
>Téléphone: 514.381.5112  Fax: 514.381.4995 
>www.archeotec.ca 
>On Jul 30, 2015 5:45 PM, "berndv. [via OSGeo.org]"
><ml-node+s1560n5217887h58 at n6.nabble.com> wrote: 
>
>	
>
>
>Hi Shane, I think without a screenshot, we have no chance to really get
>an idea what it's all about. Best to use a service like
>http://imgur.com/ and post the link cause the list will bounce too
>heavy attachments. Bernd Am 30.07.2015, 23:11 Uhr, schrieb Tom Lennon
>< [hidden email] >: <blockquote style="border-left:2px
>solid #cccccc;padding:0 1em" style="margin:0 0
>0.8ex;border-left:#0000ff 2px solid;padding-left:1ex"> Hi
>Shane: Have you tried moving the parking lot layer to below the road
>layer? That way roads over parking lots would always show. Tom On Thu,
>Jul 30, 2015 at 3:05 PM, Shane < [hidden email] > wrote:
><blockquote style="border-left:2px solid #cccccc;padding:0
>1em" style="margin:0 0 0 0.8ex;border-left:1px #ccc
>solid;padding-left:1ex">  Hi group, 
>
>   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. 
>
>   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? 
>
>   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. 
>
>   Shane 
>
>_______________________________________________ 
>Qgis-user mailing list 
>[hidden email] 
>http://lists.osgeo.org/mailman/listinfo/qgis-user 
>-- [hidden email] 
>
>-- Bernd Vogelgesang Siedlerstraße 2 91083 Baiersdorf/Igelsdorf Tel:
>09133-825374 _______________________________________________
>Qgis-user mailing list
>[hidden email] 
>http://lists.osgeo.org/mailman/listinfo/qgis-user 
>
>	
>	
>	
>	
>	
>	
>	
>		If you reply to this email, your message will be added to the
>discussion below: 
>		http://osgeo-org.1560.x6.nabble.com/Layer-question-tp5217849p5217887.html
>
>	
>	
>		To start a new topic under Quantum GIS - User, email
>ml-node+s1560n4125267h38@n6.nabble.com 
>		To unsubscribe from Quantum GIS - User, click here . 
>		NAML 
>	
>
>
>
>--
>View this message in context:
>http://osgeo-org.1560.x6.nabble.com/Layer-question-tp5217849p5217890.html
>Sent from the Quantum GIS - User mailing list archive at Nabble.com.
>
>------------------------------------------------------------------------
>
>From: Nick Papadonis <npapadonis at gmail.com>
>To: "Håvard Tveite" <havard.tveite at nmbu.no>
>Cc: qgis-user at lists.osgeo.org
>Sent: Fri Jul 31 00:45:56 BST 2015
>Subject: Re: [Qgis-user] How to convert raster routes into vector
>format?
>
>Hi Havard,
>
>Unfortunately, the expression below results in a complete black TIFF. 
>I am referencing the correct layer.  Any ideas?
>
>Thanks
>Nick
>
>> On Jul 29, 2015, at 4:34 PM, Håvard Tveite <havard.tveite at nmbu.no>
>wrote:
>> 
>> With QGIS 2.10, the following should work (probably also OK
>> for earlier versions).
>> 
>> Check the band values of your colour using the info button,
>> and use the values in the expression below (assuming the
>> name of your raster layer is yourraster) instead of 116, 20
>> and 31:
>> 
>> ("yourraster at 1" = 116  AND "yourraster at 2" =  20 AND "yourraster at 3" =
>31) * 1
>> 
>> This should give you a binary raster with 1 in the pixels
>> that have your colour and 0 in the pixels with other colours.
>> 
>> In the style dialogue you can use the following to see the
>> resulting binary image:
>> Colour gradient: "white to black"
>> Min: 0
>> Max: 1
>> 
>> You should be able to use r.thin on that image, but I am not
>> able to test this now, as I am on Ubuntu, and have not been
>> able to get GRASS to work through Processing on that platform
>> for QGIS 2.10.
>> 
>> Håvard
>> 
>> On 29. juli 2015 16:40, Nick Papadonis wrote:
>>> Hi Håvard,
>>> 
>>> 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.
>>> 
>>> Thanks again,
>>> Nick
>>> 
>>>> On Jul 29, 2015, at 7:18 AM, Havard Tveite <havard.tveite at nmbu.no>
>wrote:
>>>> 
>>>> If you are going to use GRASS r.to.vect (for instance through QGIS
>>>> Processing), you will need a binary skeleton image.
>>>> You could get one by using the raster calculator to extract
>>>> your single colour as a binary image, and then GRASS r.thin
>>>> (available in QGIS Processing) to get the skeleton.
>>>> 
>>>> Håvard
>>>> 
>>>> On 29/7/2015 8:36:AM, Nick Papadonis wrote:
>>>>> Hi Folks,
>>>>> 
>>>>> 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?
>>>>> 
>>>>> Thanks again
>>>>> _______________________________________________
>>>>> Qgis-user mailing list
>>>>> Qgis-user at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>> 
>>> 
>
>
>
>
>------------------------------------------------------------------------
>
>From: Nick Papadonis <npapadonis at gmail.com>
>To: Qgis-user at lists.osgeo.org
>Sent: Fri Jul 31 02:07:44 BST 2015
>Subject: [Qgis-user] Raster Calculator Expression to determine color
>
>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
>
>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
>
>
>------------------------------------------------------------------------
>
>From: Nyall Dawson <nyall.dawson at gmail.com>
>To: Nick Papadonis <npapadonis at gmail.com>
>Cc: Qgis-user at lists.osgeo.org
>Sent: Fri Jul 31 02:29:34 BST 2015
>Subject: Re: [Qgis-user] Raster Calculator Expression to determine
>color
>
>On 31 Jul 2015 11:07 am, "Nick Papadonis" <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?
>
>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
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>------------------------------------------------------------------------
>
>From: Nick Papadonis <npapadonis at gmail.com>
>To: Nyall Dawson <nyall.dawson at gmail.com>
>Cc: Qgis-user at lists.osgeo.org
>Sent: Fri Jul 31 02:30:44 BST 2015
>Subject: Re: [Qgis-user] Raster Calculator Expression to determine
>color
>
>
>> 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?
>> 
>> 
>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).
>
>Thanks
>> 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>
>
>
>------------------------------------------------------------------------
>
>From: Nick Papadonis <npapadonis at gmail.com>
>To: Nyall Dawson <nyall.dawson at gmail.com>, Qgis-user at lists.osgeo.org
>Sent: Fri Jul 31 02:56:24 BST 2015
>Subject: Re: [Qgis-user] Raster Calculator Expression to determine
>color
>
>
>> 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>
>
>
>------------------------------------------------------------------------
>
>From: Nick Papadonis <npapadonis at gmail.com>
>To: Qgis-user at lists.osgeo.org
>Sent: Fri Jul 31 05:39:12 BST 2015
>Subject: Re: [Qgis-user] Raster Calculator bug?
>
>Folks,
>
>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:
>
>a) (“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
>b) ((“m at 1" < 238 AND “m at 1" > 210) * 1) * ((“m at 2" < 123 AND “m at 2" > 94)
>* 1) * ((“m at 3" < 130 AND “m at 3" > 98) * 1)
>
>I then tried the following individual expressions for each band as
>separate steps (sanity check) and they work to cover the pixels in
>range:
>c) (“m at 1" < 238 AND “m at 1" > 213) * 1
>d) (“m at 2" < 123 AND “m at 2" > 98) * 1
>e) (“m at 3" < 125 AND “m at 3” > 99) * 1
>
>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:
>f) ((“m at 1" < 238 AND “m at 1" > 210) * 1) + ((“m at 2" < 123 AND “m at 2" > 94)
>* 1) + ((“m at 3" < 130 AND “m at 3" > 98) * 1)
>
>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?
>
>Thanks again,
>Nick
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Qgis-user mailing list
>Qgis-user at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/qgis-user

--
Jonathan Webb 
Freelance GIS specialist
07941 921905
www.jwebbgis.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150731/25b71603/attachment.html>


More information about the Qgis-user mailing list