Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

3 Answers 3

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

Simple answer: No.

Not yet at least (except for the scaling based on one attribute). So-called data-defined styles are currently being discussed on the mailing list.

My approach so far was to generate a style file with all those dozens of rules using e.g. Python. My approach is to write one version of the rule and save the .qml. Then I open it to find the definition and throw it into some loops for all the combinations I need.

share|improve this answer

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


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.