11

I'm working on QGIS on a street shp file which has Left From, Left To, Right From, Right To fields fields, building a geocoder.

I need to know which way these features are oriented, which I think is the same as knowing which of the two (or more) points that make the lines comes first.

Is there a way to automatically rotate a triangle marker on the marker line style so that it shows how the line is oriented?

  • you may need to rotate the markers by 90 degrees to follow the line, depending on the symbol you use. Are you using Simple Markers or SVG markers, and which version of QGIS are you using? Have you tried using map units/pixels instead? – Steven Kay Jun 22 '16 at 19:56
18

Simplest way is to style the line. Add a new symbol layer to your line and change the 'Symbol Layer Type' to marker line. Select 'Marker' in the style tree and select a triangle as your default marker symbol. I believe 'triangle 2' is your best bet. Accept these changes and all your lines will now have arrow showing the direction of the line. You can mess around with distances and marker placement to make it look better but this essentially show you where your lines are going.

  • I've been trying with that option, but i can't handle the marker's size. It's acting in a quite strange manner: no matter the size I define (I've tried from 2 to 2000mm), the triangle stays the same tiny little, almost invisible spot over the line. I thought it had to do with my line width being asociated with one of the fields (street width), but when I deactivated this asociation, the problem stays. – Facundo Perez Jun 22 '16 at 15:34
  • +1 Works for me : i.stack.imgur.com/nQVYG.png – kttii Jun 22 '16 at 16:24
  • Perez, did you check that the measurements were not map units and were instead in mm or pixels. That is the only reason I can think of why you have very small triangles if you have particularly long lines. Do they still remain small when you zoom right in (1:1) or just retain there scale? – Knightshound Jun 23 '16 at 7:04
  • It must have been some kind of bug. They were on mm but did not retain the scale. Once I closed and reopened the project, it started working. – Facundo Perez Jun 23 '16 at 13:14
2

Following up on Knightshound's answer, it looks like there were some slight changes to the marker symbols in QGIS 3. After selecting 'Marker' in the style tree, you may not see 'triangle 2' as an option in the list of symbols. If so, look at the drop down list labelled 'Symbols in'. In my version, 3.0.3, this defaulted to 'Favorites'. If you change it to 'All Symbols', you should see 'triangle 2'.

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.