<div dir="ltr">Hi Devs,<div><br></div><div>I'm trying to implement a fix for <a href="https://github.com/mapserver/mapserver/issues/5029">#5029</a>, but I'm not quite sure about the expected interpretation of layer->scalefactor.</div><div><br></div><div>According to mapwms.c the value is set as follows:</div><div><br></div><div><div><i><font size="1">if(GET_LAYER(map, i)->sizeunits != MS_PIXELS)</font></i></div><div><i><font size="1">        GET_LAYER(map, i)->scalefactor = (msInchesPerUnit(GET_LAYER(map, i)->sizeunits,0)/msInchesPerUnit(map->units,0)) / map->cellsize;</font></i></div><div><i><font size="1">      else if(GET_LAYER(map, i)->symbolscaledenom > 0 && map->scaledenom > 0)</font></i></div><div><i><font size="1">        GET_LAYER(map, i)->scalefactor = GET_LAYER(map, i)->symbolscaledenom/map->scaledenom;</font></i></div><div><i><font size="1">      else</font></i></div><div><i><font size="1">        GET_LAYER(map, i)->scalefactor = 1;</font></i></div></div><div><br></div><div>But in mapdraw.c we have:</div><div><br></div><div><div><i><font size="1">for(i=0; i<map->numlayers; i++) {</font></i></div><div><i><font size="1">    if(GET_LAYER(map, i)->sizeunits != MS_PIXELS)</font></i></div><div><i><font size="1">      GET_LAYER(map, i)->scalefactor = (msInchesPerUnit(GET_LAYER(map, i)->sizeunits,0)/msInchesPerUnit(map->units,0)) / geo_cellsize;</font></i></div><div><i><font size="1">    else if(GET_LAYER(map, i)->symbolscaledenom > 0 && map->scaledenom > 0)</font></i></div><div><i><font size="1">      GET_LAYER(map, i)->scalefactor = GET_LAYER(map, i)->symbolscaledenom/map->scaledenom*map->resolution/map->defresolution;</font></i></div><div><i><font size="1">    else</font></i></div><div><i><font size="1">      GET_LAYER(map, i)->scalefactor = map->resolution/map->defresolution;</font></i></div><div><i><font size="1">  }</font></i></div></div><div><br></div><div><br></div><div>In my understanding layer->scalefactor should contain the resolution factor (to have the symbols to scale properly) so the corresponding code in wms.c is incorrect.</div><div><br></div><div>However the legend drawing code uses layer->scalefactor * image->resolutionfactor which causes a double magnification for the symbols.</div><div><br></div><div>Let me know about the expected behaviour.</div><div><br></div><div>Thanks,</div><div><br></div><div>Tamas</div><div><br></div><div><br></div></div>