<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:Calibri;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal;
font-family:Calibri;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:Calibri;
color:windowtext;}
span.msoIns
{mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
color:teal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Sorry I forgot to say that I have tried the script with the following versions with the same results.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">MapServer version 7.0.3 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">MapServer version 6.4.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">mapserver-users <mapserver-users-bounces@lists.osgeo.org> on behalf of Paul Moen <pmoen@nd.gov><br>
<b>Date: </b>Thursday, March 30, 2017 at 10:45 AM<br>
<b>To: </b>"mapserver-users@lists.osgeo.org" <mapserver-users@lists.osgeo.org><br>
<b>Subject: </b>[mapserver-users] PHP mapscript createLegendIcon doesn't follow style maxscaledenom<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Times New Roman""><o:p> </o:p></span></p>
</div>
<div style="mso-element:para-border-div;border:solid black 1.0pt;padding:0in 0in 0in 0in">
<p align="center" style="text-align:center;border:none;padding:0in"><strong><span style="font-size:11.0pt;font-family:Calibri;color:black">CAUTION:</span></strong><span style="font-size:11.0pt;font-family:Calibri;color:black"> This email originated from an
outside source. Do not click links or open attachments unless you know they are safe.</span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt">I am finding that createLegendIcon returns a different legend item than what is used in the map output when using scaledenom in the style.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Below is a test script that produces what I am talking about.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The script will create 4 images.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">map_scale_873.png -> map->draw output with a 873 scaledenom</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">map_scale_2618.png -> map->draw with a 873 scaledenom</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">legimg_scale_873.png -> createLegendIcon output with a 873 scaledenom</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">legimg_scale_2618.png -> createLegendIcon output with a 873 scaledenom</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I was expecting that the legend image at the 873 scale, legimg_scale_873.png would match the map output, map_scale_873.png. Can anyone see a problem, is this a bug, or is this expected behavior?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><?php</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">$mapstr = <<<EOT</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">MAP</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> NAME AERIAL</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> EXTENT 100 100 400 400</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> SIZE 100 100</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> UNITS FEET</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> LAYER</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> NAME 'TEST'</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> STATUS ON</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> TYPE LINE</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> FEATURE</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> WKT 'LINESTRING(250 250, 250 500, 500 500, 500 250,250 250)'</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> CLASS</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> NAME "Boundary"</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> STYLE</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> WIDTH 4.0</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> MAXWIDTH 6.0</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> COLOR 150 255 150</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> MAXSCALEDENOM 1000</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> STYLE</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> WIDTH 2.0</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> MAXWIDTH 2.0</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> COLOR 0 0 0</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> PATTERN 20.0 10.0 5.0 10.0 END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> MAXSCALEDENOM 1000</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> STYLE</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> WIDTH 4.0</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> MAXWIDTH 4.0</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> COLOR 150 255 150</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> MINSCALEDENOM 1001</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">END</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">EOT;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $map = ms_newMapObjFromString($mapstr);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $map->selectOutputFormat('png');</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $img=$map->draw();</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $name=round($map->scaledenom);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $img->saveImage("map_scale_$name.png");</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $tmpLay =$map->getLayer(0);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $tmpclass = $tmpLay->getClass(0);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $tmpImg = $tmpclass->createLegendIcon(50,50);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $tmpImg->saveImage("legimg_scale_$name.png");</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $map->setextent(200,200,300,300);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $img2=$map->draw();</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $name=round($map->scaledenom);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $img2->saveImage("map_scale_$name.png");</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $tmpImg->saveImage("legimg_scale_$name.png");</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">?></span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Paul</span><o:p></o:p></p>
</div>
</body>
</html>