Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've been working on making mountain biking and hiking maps using Illustrator and I am now trying to move to QGIS so there's real GIS data powering the maps, making updating/scaling them easier than it is Illustrator.

One issue I've had is that when trails converge the trail creators/maintainers usually give the trails two colors while they are joined. Here's an example from the Illustrator version:

enter image description here

I'm using the following solution to style the trails with two colors, but I'm curious if there are other ways to accomplish this:

  • The trail features have two color attributes: color and color2
  • I enter a string value for the "color" of the trail: red, blue, etc.
  • If the trail segment has a secondary color I put it in "color2"
  • I style the layer using the "color" attribute
  • I duplicate the trail layer and change the styling of the new layer to use "color2" instead of "color".
  • I change the duplicate layer to use a dashed style of line instead of solid.

Now both layers are pointing to the same Shapefile but styling them differently.

Is this the best way to accomplish this type of styling?

share|improve this question
1  
Could you post a picture of what you're looking to produce in QGIS, i.e. an example from your Illustrator output? –  Simbamangu Jan 7 '12 at 8:56
add comment

2 Answers 2

up vote 8 down vote accepted

I came across this video which explains how to make railroad tracks in QGIS using Symbol Layers - http://linfiniti.com/2010/12/video-tutorial-1-creating-a-custom-railway-style/

I realized I could use the same feature to make two-color lines using only one layer.

I wouldn't need to have a separate color attribute (since you can't style a single layer based on two attributes)

  • Use New Symbology
  • Add a second Simple Line to the Symbol Properties
  • Make the lines the same width
  • Make the top line dashed and the primary color
  • Make the bottom line solid and the secondary color

Symbol Properties for a Two Color Line

share|improve this answer
add comment

You shouldn't have to create multiple layers. In fact, you shouldn't have to create "color" attributes. Usually, you would just name the various trails and assign different colors and symbols to the different names. Once you run into a combined trail, you could name it, "Pacific Crest Trail / Appalachian Trail" and then create a unique symbol style for that attribute.

I am talking general concepts here. I'm not exactly sure how you would do it in QGIS.

share|improve this answer
    
Well the color attributes match the "blazes" they choose for the trails. It is indeed an attribute of the trail that I want to track. And what I'm asking is how to specifically do a two color line in QGIS. –  Brian Kelly Jan 6 '12 at 20:46
    
I gotcha. I was only saying that you don't have to, not that you shouldn't :) –  jvangeld Jan 6 '12 at 23:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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