Bug report #8887

qgis don't use correctly the map-units in dimension of data-defined-properties for SVG

Added by aperi2007 - about 7 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Radim Blazek
Category:Symbology
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:17566

Description

when use a SVG symbol, and choose a data-definition field for the dimension.

QGIS sclae the symbol, ma don't follow correctly the scale.

If I choose the "millimeters" unit it work correctly, but if I choose the "map unit" it grow but not proportionally to the
scale.

Associated revisions

Revision 3256c926
Added by Radim Blazek almost 7 years ago

Add scale method to data defined size label, related to #8887

Revision 71c1ad10
Added by Radim Blazek almost 7 years ago

sqrt symbol size for ScaleArea before scale to context units, fixes #8887

History

#1 Updated by Radim Blazek almost 7 years ago

  • Resolution set to invalid

There is no bug but it is quite tricky. Data defined size may be used in two modes as area or diameter. Unfortunately that mode is set on renderer level (far from data defined size definition) in renderer widget "Advanced -> Size scale field -> Scale area / Scale diameter". If the mode is area (default), square root of the value is used for symbol size. It applies also to simple marker.

In 3256c92 I added to the size property label also the mode. So it looks like:
  • Size (area)
  • Size (diameter)

Hopefully sufficient, there is no space for longer description.

The question is if the mode should be applied on renderer level. Maybe it should be moved down to symbol layers definition. More symbols with different modes may be required. There are other cases where a value may be overwritten recursively from top level (color for example), but the UI is not ideal, it should be more obvious that the value is going to be applied to all (not always) subitems.

BTW: the mode name 'area' is not perfect, because it is using simply square root and does not consider real symbol shape. So the resulting areas (circle for example) are not really equal to the data value. This may be quite dangerous and it should be shown in UI more explicitly, but where?

The symbology UI needs to be enhanced a bit IMO.

#2 Updated by aperi2007 - almost 7 years ago

Hi,

I understand the explanation of simply square root not always right to resize a symbol.

But, I guess perhaps there some other code bug, because also thinking to a simple square root resize the symbol seem do not resize correctly when the scale change.

#3 Updated by Radim Blazek almost 7 years ago

  • Status changed from Open to Closed

#4 Updated by Radim Blazek almost 7 years ago

aperi2007 - wrote:

But, I guess perhaps there some other code bug, because also thinking to a simple square root resize the symbol seem do not resize correctly when the scale change.

I have to apologize, there was really a bug in order when sqrt was applied for svg and simple symbol.

#5 Updated by Radim Blazek over 6 years ago

Ticket fixed with funding from Regione Toscana-SITA (CIG:ZB10C90E5A).

#6 Updated by Radim Blazek over 6 years ago

  • Assignee set to Radim Blazek

Also available in: Atom PDF