One of the nice new features in QGIS 2.4 is to be able to offset markers (e.g. arrow heads) along a line as part of the styling. I am trying to display a dataset of simple lines (not polylines) with an arrowhead 90% of the way along the line. My attempted method is as follows:

Layer Properties -> Style -> Symbol -> Change...

  • Select "Marker Line"
  • Marker placement: on first vertex only
  • Offset along line: Map Unit
  • Data Defined Properties...
    • Offset along line = $length * 0.9

This works fine when my layer projection was the same as for the project (all EPSG:27700 - OSGB 1936 / British National Grid). However, now that I have added an OpenStreetMap basemap layer, it seems that can't be re-projected so I have to switch my project CRS to that of OpenStreetMap (EPSG:3857 WGS 84 / Pseudo Mercator). Putting in a "fiddle factor of" 1.6 seems to do the trick ($length * 0.9 * 1.6), but that's a bit of an unpleasant hack. Better solutions?

Your Answer

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

Browse other questions tagged or ask your own question.