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 need to draw an telephone or energy lines as is done on the polish-core map. Thelephone line was drown by the polyline. I tried the SVG symbols, when I have a lot of single-lines, for each I 'put' symbol svg on the first and the last vertex. For polylines, unfortunately, line markers located on the central vertexs do not rotate to the next segment, but are suspended 'in the air'.

If someone has already tested this, I'd like to know the rules. I enclose a snapshot of my unsuccessful endeavors.

The effect of mine line style

And below is the effect that I need, (now its generated by Inkscape)

The effect that I need

Thanks for the reply.

share|improve this question
    
Could you add a picture of how it should look like? –  underdark Apr 21 '12 at 10:41
add comment

3 Answers

Perhaps there are better ways of doing this, but for what it's worth:

  1. Create a line layer for the fine, broken lines and draw the lines.

  2. Create a line layer for the solid lines and draw the solid lines, snapped to the fine lines. Draw the lines one segment at a time in the direction that you wish the arrows to point.

  3. Style the solid lines with arrowheads, as shown in the picture.

Horrible, I know. Hope you don't have too many to draw:) Nick.

enter image description here

share|improve this answer
    
The idea is simple, but I have much more than 5.000 polylines, with 10~20 vertex at each one. The problem is: how to rotate markers or svg-symbols to the segment azimuth (angle) automatically. Thanks Nick, Tom. –  tomsik Apr 22 '12 at 16:27
    
..or can I create line style with only 3meters lenght line at start and the end of each segment of polyline. –  tomsik Apr 22 '12 at 16:39
    
Did you find a solution to the problem Tom? I have one that might do if you haven't, but it will take some explaining. Nick. –  nhopton Apr 24 '12 at 18:23
    
No, I have not found yet. I will be grateful for the description of your method. –  tomsik Apr 24 '12 at 20:43
    
See second answer, below. Nick. –  nhopton Apr 25 '12 at 9:17
add comment

This was using QGIS Master.

Firstly, load the lines and extract their nodes to a new point shapefile. Next buffer the points and use the buffer layer to clip the line layer. This will give you the 'corners' that you need, in a new shapefile. Each 'corner' will comprise one line having two segments.

Use the 'Split Feature' plug-in to convert all of the line segments in the 'corners' shapefile to individual lines. You will now have a new shapefile containing the split lines. What we need to do now is to change the direction of every other line in the shapefile. So, load the new shapefile, open its attribute table and put it in edit mode. Then, create three new integer columns. Use the field calculator to populate the first column with numbers ($rownum will do this). The numbers will start at zero, which we don't want, so populate the second column with values from the first column plus one.

Okay so far? Now we have all of the lines numbered in a column. What we have to do now is to populate the third column with '0's or '1's depending on whether the number in the second column is odd or even. Do this using the Field Calculator (if the second column is called 'NUMBER' then 'NUMBER%2=0' will do this).

We can now select the even-numbered lines ready for changing their direction. Search for all of the rows having '1' in the third column, which will select them. Then (leaving the shapefile in edit mode) use the 'Swap line direction' plug-in to swap the direction of the selected lines. Then save the shapefile.

After that, style the layer as shown in my illustration.

Sorry if this is all a bit gothic, but it's the only workflow I can come up with. Surely, there must be better ways? But it works and eliminates the need for a lot of manual labour. Let me know if you have problems. Nick.

share|improve this answer
    
Your answer is very helpful. The lines after the modification are exactly that view that I need. I hope the problem in the QGIS will be removed soon. Thanks a lot for Your patience. –  tomsik May 11 '12 at 22:53
    
If it would be of any use, I did in the end find a way of doing this in QGIS 1.7.4. In some ways it's easier than the method outlined above. Let me know if you are interested. Nick. –  nhopton May 12 '12 at 7:43
    
Yes I am very interested to know any methods to do this, what I've asked for. If You be a kind to explain, I'll be very grateful. Tom. –  tomsik May 19 '12 at 20:00
add comment

Maybe you've found a better solution by now, but this was an interesting exercise for me.

The basic concept is to create one symbol layer for each piece. I had six layers in total. See energy_line.qml, but you may need to tweak the sizes and offsets to suit your needs. (The style is applied to a "split" copy of the original linestring; i used the Split Feature plugin)

Summarized description:

  1. simple line, solid black 0.1
  2. marker line, simple marker, chevron, last vertex only, x=5, size=2, angle=180
  3. marker line, simple marker, chevron, first vertex only, x=5, size=2, angle=0
  4. marker line, simple marker, vertical bar, last vertex only, y=4, size=8, angle=90
  5. marker line, simple marker, vertical bar, first vertex only, y=4, size=8, angle=270
  6. red dot, every vertex

Using this method, I don't see any way to control the lineweight of the arrows, so if more contrast is needed i think you'll need to switch to thicker svg symbols of the chevron/bar.

symbol properties

share|improve this answer
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.