Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While trying to find a useful way having earthquakes displayed, I noticed that it isn't that easy to manage.

I'd like to be able to recognize the "Magnitude", "Date", and "Depth" from the style of the point. Something like:

  • size: based on magnitude
  • depth: basic color (ex. <15 red, 15-30 yellow, >30 blue)
  • date: intensity of color as shading from 100% color to white/...

Is there a way to do so without defining dozens of rules?

share|improve this question

Why not using the rule-based labeling? You could ease up the task a lot, if you use categories for multiple gradients based on your attribute data. From my point of view using categories in rule-based labeling is one of the mayor advantages of QGIS.

For your data (without knowing the structure) i would recommend the following workflow:

  • Make a rule based simple gradient for your date-values via the categorized or graduated point styler (white or greyish style).
  • Adjust the size of the points by clicking on "advanced" and "size scaled field". Here select the magnitude of your points. Save the resulting style as SLD style!
  • Go to rule-based labeling, load jn your SLD and add for each data-point per rightclick a category (or range) with the color gradient of your liking for your depth and apply it to each ruleset.

Like this (you could also make a category on rules in a category ;-) ): enter image description here

  • Afterwards don't forget to adjust the rendering order and maybe control for the sizes of the points.

I understand that this solution depends on some effort (mouseclicks) on your site, but in the end a beautiful map is always worth the effort.

share|improve this answer

Updated for QGIS 2.8

Assuming data like this:

id | magnitude | date | depth
 1 |     4     | 1912 |  100
 2 |     3     | 1932 |   85

Using data-defined styling, set the size to be controlled by the magnitude field.

For the color, which is defined by date and depth, you can use the following expression

  WHEN depth < 15 
       THEN color_hsl(1, 100, scale_linear(date, 1900, 2015, 100, 50)
  WHEN depth >= 15 AND depth < 30 
       THEN color_hsl(60, 100, scale_linear(date, 1900, 2015, 100, 50)
  WHEN depth >= 30 
       THEN color_hsl(240, 100, scale_linear(date, 1900, 2015, 100, 50)

"Old" points from 1900 will be white hsl(x,x,100) while new points are more colorful up to hsl(x,x,50).

share|improve this answer

Here us a tutorial to style using 2 attributes, using earthquake data itself.

share|improve this answer

Thee other option is to use a size assistant that is available for each of the data layer style. Say you categorized your point data based on color using a certain attribute. Simply right click each category and select Change Size. It should display a size dialog box. Then click on the expression filter and then select Size Assistant.

enter image description here

The size assistant dialog box has option to choose the column to size by. You can also choose the scale method you want to scale your symbols by and then provide the range of sizes and the corresponding range of your data values. enter image description here Note you will need to do this for each category of your data.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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