Line pattern fill only along edge of polygon

I think you can use Geometry generator.

Following this post Geometry generator symbology by Matthias Kuhn, you can:

  1. Choose Geometry generator
  2. Type in expression: difference($geometry, buffer($geometry, -100))
  3. Set Line pattern fill

enter image description here


I'm going to add another suggestion because this question has just popped up as a duplicate so might get some more traffic.

If you can stomach some processing it's possible to get exactly what you want by physically buffering rather than using the geometry editor as in the accepted answer. This should also do away with the issues identified in the comments above (I think).

  1. Run a fixed (or variable if you need different features to have a different hashing pattern) distance buffer on the features you want to symbolise, using a minus value to reduce the size of the feature.

enter image description here

  1. Run the 'Difference' tool from the Vector Geoprocessing menu to doughnut hole cut the original feature and drop this new dataset into the TOC above the original

enter image description here

  1. Symbolise the original dataset with a simple outline (and either no fill or whatever colour you want) and the new doughnut dataset with no outline and a hash fill

enter image description here


You can also uncheck the rotate marker option and tweak the line interval and offsets (sorry that my UI is only partially in English).

enter image description here