Monday 30 May 2016

style - How to graphically offset the boundary line of a polygon in QGIS?


In Arcgis, there is a way to offset graphically the contour line of a polygon like below. I'm trying to do the same thing in a styling method (i.e the solution can't be by buffering physically the layer). QGIS does have an offset option, but it's an XY type offset that moves the position of the line.


graphic offset of lines


ANSWERS :


Way 1: use the geometry generator fill style. Just get in the box buffer($geometry,[your buffer distance]). The only difference is that Arcgis offsets the line whereas this solution creates a buffer, thus rounding the edges...



geometry generator


Way 2 : exact replica of Arcgis, inspired below by @iant answer : create in the style another style "Outline : Simple line". In this style, there is the offset box i was looking for ! It does exactly the same as in arcgis.


offset line



Answer



Another way to do this is to duplicate the layer and use a negative offset to go outside the polygon when styling with a simple line fill. Or just have a simple fill and a simple line with the offset.


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...