I have a layer with the city streets. I have a database with traffic values, including traffic going into the city and traffic going out from the city.

I need to show the street links with different colours based on the number of vehicle going into the city (red at the right of the link) and the number of vehicles going out from the city (blue at the left of the link). I also need for the colours to be proportional based on value. Can you help me?

  • Are the traffic values something like id, in, out? and is there something you can join the layers on? – Nathan W Mar 25 '13 at 13:03

So something like this

enter image description here

if so you can do this with the rule-based renderer.

  1. Join your values layer onto the street layer using a comman id. Help on that here
  2. Select the Style tab on the line layer properties dialog.
  3. Change the renderer to "rule-based"
  4. Create three rules with no filter. In, Out, Road.
  5. Disable the style for In and Out rules

It should look like this:

enter image description here

  1. Next select the In rule and click the "Refine current Rules" button.
  2. Select "Add ranges to rule"
  3. Click Change on the Symbol button.
  4. Offset the line Symbol by -3 or -4 (if doing OUT values use +3 or +4). Click OK.

enter image description here

  1. Change the color and classes. Hit classify. Click OK

enter image description here

  1. Ranges should be inside In rule

enter image description here

  1. Repeat 6-11 for OUT values.

Note: You don't really need the In and Out blank filter values but it helps to keep things grouped.

In the end you should have something like this:

enter image description here

  • That's it! :) I only need to understand why it shows all the streets for every interval (it seems it do not recognize the rules) and how to make the bandiwth proportional to the value but this is the way :) – Giulio510 Mar 25 '13 at 15:13
  • If yo can upload a sample set somewhere we might be able to help more. – Nathan W Mar 25 '13 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.