Saturday, 30 April 2016

cartography - Polygon gradient fills / tint bands in QGIS


Is it possible to use a gradient fill on a polygon in QGIS?


I would like to have my polygons with a colour at the edges, fading to clear/white as it moves away from the edge. The majority of the centre of the polygon will be white or clear.



It is something people I know who use Illustrator can do. I wondered if there was a way to emulate it in QGIS.


Here is an example. I would like something like the purple shading.


enter image description here


Update:


This method suggested below does work, however it produces some annoying extra bits for my polygons. For example, see the image below:


enter image description here


I am unsure how to remove these. I cannot use a mask as I need to be able to see the base mapping and other data outside of this polygon on layers that are below this layer. Using a mask would obscure all of these layers.


I have included a link to Underdarks blog post about this, which gives more detail, and contains the code to set this up.


http://underdark.wordpress.com/2011/08/08/creating-a-gradient-fill-for-polygons-in-qgis/



Answer




There is no option for gradient fill as far as i know. But you can emulate a gradient if you don't mind some work creating your own symbol. I've done a quick example with only four color step, so it's not a smooth gradient ... but you get the idea.


All you have to do is create layers of type "simple line" and give them a positive offset. That will move the border "inside" the polygon. Don't forget to enable symbol levels for a clean rendering.


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...