Friday, 5 January 2018

qgis - Gradient colour for lines


My road network is broken up into segments. I want to produce a map that shows where the segments start and finish.


I don't really want to create a point layer that shows the location of the ends of each line, but will if I have to. And I know that I could categorise segments and use a colour ramp or random colours, but I was looking for something that would look a little more classy.


I was wondering if there is a way to use a colour ramp - or gradient fill - for lines in QGIS? What I envisage is every line segment starts with one colour and finishes with another colour. This would also serve to indicate line direction - another one of my requirements.


Any ideas? Johanna



Answer




In the moment there is no way to colour lines with a gradient style.


First buffer your linestrings. Then you can set a gradient colour for the buffer polygons.


Here is a HowTo: How to visualize measure values along linestrings in QGIS?


Another Idea


requirement: your lines have an disinct ID




  1. Cut your linestrings in very small substrings (that it looks like a gradient).


    "______" linestring with id 1 and 100m


    "----------" every single substring must have a distinct id or serial number. Here 1 to 10 (one substring 10m). When all the linestrings have the same direction it would start with 1 und end up with the maximum count of substring.




    1. Categorize the substrings and use a color ramp: 1 green 10 (n substrings) red




Problem could be the large amount of classes, if you have very long linestrings.


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