3

I have a designed a map using a scaled simple marker symbol. It is a rule-based design and symbol scaling is done by the siye assistant based on a field value for any of the rules in the same way. Everything works fine within the the map - legend / table of contents symbols are scaled according to map scale, within the print composer / item properties-window symbol scaling works fine as well.

However, the legend of my map-layout doesn't show any symbols.

Strange: changing scales in the layout (via map/item properties/scale) changes line spacing of my map-legend - indicating that there is information about how to scale symbols somewhere in the background.

... but the symbols remain invisible in the map-legend. Does anyone have any ideas?

QGIS 3.2 Mac and Windows.

symbol scaling 1:10.000symbol scaling 1:25.000

  • 1
    The cartographer says: Why do you have symbols of different size, while each point only stands for one kindergarden? Differently sized symbols indicate a second value you want to present, like the number of children visiting a given kindergarden. So, it would be more appropriate to not to have different symbol sizes. – Erik Jun 26 '18 at 9:48
  • @ErikLohmann I agree with you, however I interpret the title "nach Typ und Betreuungsplätzen" as "according to type and number of childcare facilities". And since in the map there are markers with the same color but different size, I assume this represents the number of children each kindergarden can accomodate. Of course it would be better to have an extra legend which shows the size difference and show the different categories in the legend only in one size. Besides that, it doesn't solve the problem, that scaled symbols are somehow not shown in the legend. – tallistroan Jun 26 '18 at 10:26
  • 1
    Mea culpa, didn't realize there are differently sized symbols for each colour. Still, I couldn't reproduce the error (using QGis 2.18). Maybe some more details on how the symbols are produced could shed some light. – Erik Jun 26 '18 at 10:36
  • @tallistroan - right. size is depending on the number of children for each location while color represents different types (i.e. public vs. private). and yes it would be better to have an extra legend - but qgis doesn't privide this tool at all. so i would be pretty happy if the scaling was working correctly. – robert tuw Jun 26 '18 at 11:47
  • @ErikLohmann - roules are based on filter expresions like "FIRST_TXTATT1_12" = 'Öffentlich'; size is scaled by size assistant which produces the following expression: coalesce(scale_exp("SUM_kinder_0_bis_67_68", 0, 335, 20, 250, 0.57), 0). the intresting thing is, that symbols in table of content as well as in the legend-section of composer are displayed and scaled correctly while they arn't even displaye within the legend of the map-display in copmposer – robert tuw Jun 26 '18 at 11:50
9

I am able to reproduce your error using QGIS 3.2.0, but it works when using QGIS 2.18.21. There are also already a couple of bug reports regarding the size assistant, with this one being probably the most recent and accurate regarding your problem.

Having said that, there is the possibility for creating a also cartographic more appealing solution with a small workaround. Since your two attributes "type of kindergarden" and "number of children" are not directly connected it is possible to show the size of your points separate from the color for each category.

For this solution choose "Categorized" as the symbology type for your layer, then choose the column with the kindergarden type and classify your data according to your needs. Add the size scaling with the size assistant for the symbol. Now your points should have different sizes, depending on your data.

On the bottom right of the layer styling panel you select Advanced > Data-defined Size Legend and enable the collapsed or separated legend according to your needs:

enter image description here

Now this should be visible in the Layers panel and also in your legend. However there we have again the problem, that the symbols for the categories are not shown, which is probably again related to the bug you described and in the legend it now looks like this:

enter image description here

A workaround for this problem: Duplicate the original layer (this layer can be turned off in the map), deactivate the size based styling and the Data-defined Size legend for the new layer and add this duplicated layer to the legend. Delete the category names without symbols from the original layer in the legend manually and now your legend should show your desired result:

enter image description here

  • thx for the information about the bug report, and of course for the "workaround" ... really nice ! – robert tuw Jun 26 '18 at 13:58
  • concerning the bug report you have mentioned i am not quite shure ... because symbol scaling in the layer tree and the symbology tool works pretty well, just the legend within the composer-map is faulty. with the settings i've been using. implementing your workaround shows interesting results (see my "answer" below): the advanced tool, the legend propertie preview and the map-legend display disproportionaly scaled symbols. ... seems that i have to create a bug report. – robert tuw Jun 26 '18 at 17:32
  • Of course feel free to submit a new bug report, if none of the existing ones fits your case. I just had a quick glance at them and chose the one, which looked most applicable to your issue to me. – tallistroan Jun 26 '18 at 18:12
0

@tallistroan seems that there is a serious problem in version 3.2 ... following your workaround description resulted in correct scaled symbols on the map and ugly results in both the Advanced > Data-defined Size Legend tool and the composer legend. obviously the sizes do not correspond to the map scale and to symbol sizes within the map.

qgis application window / advanced data-defined size tool:composer output: enter image description here

composer window - ledend item properties and map-output: print composer / advanced data defined size legend

  • Ideally this should be somehow incorporated into the question, since it is not really an answer. Besides that, I messed around a bit with the data from OGD Wien and tried to reproduce your problem, but for me the data-defined legend worked always like expected (in QGIS 3.2.0). If you create a bug report at the QGIS issue tracker, maybe you can add the dataset and your exact workflow, that it can be easier reproduced by whoever is then working on the issue. – tallistroan Jun 26 '18 at 18:20
  • yes in know that it should be part of the question or of a comment ... unfortunately the stackexchange framework doesn't support images in comments. before creating a bug report i will start from scratch - just to be shure. – robert tuw Jun 27 '18 at 11:23
  • 1
    i've got it: Advanced / Data-defined Size Legend works well with "Units" set to "Milimiters", "Points", "Pixels" ... if you take "Map Units" or "Meters at Scale", ... it is faulty (!) and looks like my screenshots from above. – robert tuw Jun 27 '18 at 11:35
  • Please post a link to the bug report here for future reference – underdark Jun 28 '18 at 19:04
  • link to the bug report: issues.qgis.org/issues/19282 – robert tuw Jul 13 '18 at 13:58
0

For me, I solve this problem with a "double symbol" and you can see it in the legend enter image description here

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.