Opened 19 years ago

Closed 18 years ago

#1435 closed defect (fixed)

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

Reported by: szekerest Owned by: warmerdam
Priority: high Milestone:
Component: GDAL Support Version: 4.6
Severity: normal Keywords:
Cc:

Description

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.

Change History (4)

comment:1 by szekerest, 19 years ago

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.

comment:2 by szekerest, 19 years ago

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 

comment:3 by fwarmerdam, 19 years ago

Cc: dmorissette@… added
Status: newassigned
Daniel, 

Do you have any concerns about the proposed change? 

comment:4 by szekerest, 18 years ago

Resolution: fixed
Status: assignedclosed
Marking as fixed due to the source has been changed... Thanks
Note: See TracTickets for help on using tickets.