MapServer / MapServer-import

3 stars 2 forks source link

Problem with rendering labels from OGR data source if the original label size is zero #1435

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: szekerest Date: 2005/08/08 - 22:08

Mapserver 4.6 renders labels from OGR data source with the minimum label size, 
when the original label size is zero using "STYLEITEM AUTO". In this case the 
SYMBOLSCALE setting is inefficient, scale dependent drawing of the label size 
cannot be achieved at all.
The reason of this effect is that actual scale factor is eliminated by 
multiplying with the zero label size (see msGetLabelSize in maplabel.cpp).
As a resolution msOGRGetAutoStyle in mapogr.cpp could be modified in order to 
change the label size to greater than 0 after reading the zero label size from 
the OGR source.
tbonfort commented 12 years ago

Author: szekerest Date: 2005/08/09 - 23:54

It would be worth considering to retain some layer settings of the layer class 
when using STYLEITEM AUTO. LABEL.MINSIZE, .SIZE, .ENCODING, .COLOR would be 
especially helpful. msOGRGetAutoStyle should change only those settings that 
exist in the data source and have suitable value.
tbonfort commented 12 years ago

Author: szekerest Date: 2005/11/03 - 23:38

Frank,

Please consider adding the following line to mapogr.cpp

Line 2167
  c->label.size = (int)poLabelStyle->Size(bIsNull);
> if (c->label.size < 1) c->label.size = 1;

This change could bring SYMBOLSCALE setting into effect using "STYLEITEM AUTO" 
when the original label size is 0 in the data source. Without this, the labels 
will always be drawn at the same (min) size.

Tamas Szekeres 
tbonfort commented 12 years ago

Author: fwarmerdam Date: 2005/11/04 - 01:01

Daniel, 

Do you have any concerns about the proposed change? 
tbonfort commented 12 years ago

Author: szekerest Date: 2006/02/01 - 23:22


Marking as fixed due to the source has been changed... Thanks