2

I need to style a shapefile with a specific color gradient, but considering absolute values.
It's point shapefile with values between 0.19 and 0.70 (considering they're in an absolute scale between -1 and 1).

I'm using QGIS 2.14.3.

I've build a color map using Matlab (.svg format based on the cpt-city) but the problem is that the color steps inside the .svg file are divided with percentages. I can't give the exact value the style/color I need, unless I do that manually, one by one.

I did the trick when using raster data: I've build color ramp with the exact steps and the correspondent color.

  • 1
    QGIS User Guide is very clear. – aldo_tapia Nov 22 '16 at 18:38
  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Nov 22 '16 at 19:29
  • I didn't find the answer in QGIS User Guide. The shapefiles I'm working on has hundreds of NDVI values and I need to apply the same color code to each one, so equal NDVI values has the same color through different shapefiles. My guess is to create a .qml or .sld style file with the exact values and the correspondence with the colours, but I was wondering if there's any simple way to to this procedure. – zemigl Jan 12 '17 at 11:51
1

You can use SVG2ColoR plugin.

(1) Start the SVG2ColoR plugin and read your .svg file from Matlab. I did not have such a sample, so I visited cpt-city and obtained rainbow color (just because it has plenty ~ 239 colors!) by Get URL.

enter image description here

(2) Then I clicked on Import which imports color into QGIS. In QGIS raster layer properties, I colored a dummy raster (its Min and Max values are quite important, though). Classes set to 50 (colors).

enter image description here

(3) Then I save my 50-colors rainbow as new style (.qml) file by Style -> Save Style.

(4) I have new qml file which defines 50 colors, each color corresponds to discrete values.

enter image description here

I used QGIS 2.18, but this plugin was first published in 2014. Should work for QGIS 2.14, too.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.