<html xmlns:v="urn:schemas-microsoft-com:vml" 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="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:11.0pt;
font-family:"Calibri",sans-serif;}
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.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.msipfooter5f75dde, li.msipfooter5f75dde, div.msipfooter5f75dde
{mso-style-name:msipfooter5f75dde;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:85.05pt 56.7pt 85.05pt 56.7pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1772625976;
mso-list-type:hybrid;
mso-list-template-ids:2004095790 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Should be easy enough to replicate. Does this sum it up?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-family:Symbol;color:#1F497D"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="color:#1F497D">Label TEXT w/expression followed with a comment containing ()’s - FAILS<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-family:Symbol;color:#1F497D"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="color:#1F497D">Same TEXT w/expression but with moving the comment containing ()’s onto its own line - WORKS
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-family:Symbol;color:#1F497D"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="color:#1F497D">Label TEXT w/expression followed with a comment without ()’s – WORKS<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Seems like the regex in maplexer.l for expressions might be too greedy.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">--Steve<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> mapserver-users [mailto:mapserver-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Julian Hollingbery<br>
<b>Sent:</b> Wednesday, March 20, 2019 10:49 AM<br>
<b>To:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> [mapserver-users] Mapfile comment parsing issue<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi list,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have observed an obscure behavior in MapServer version 7.0.7, which I’d like to run by you before I submit an issue.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have an issue where labels on contour line disappear when I write a particular type of comment after the TEXT directive.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Using this request:<o:p></o:p></p>
<p class="MsoNormal"><a href="http://host/fcgi-bin/mapserv.fcgi?map=ms_issue_report.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=542400.00,6216800.00,542600.0,6217000.0&CRS=EPSG:25832&WIDTH=400&HEIGHT=400&LAYERS=dhm_kote_0_5_m,dhm_kurve_0_5_m&STYLES=&FORMAT=image/png&TRANSPARENT=FALSE">http://host/fcgi-bin/mapserv.fcgi?map=ms_issue_report.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=542400.00,6216800.00,542600.0,6217000.0&CRS=EPSG:25832&WIDTH=400&HEIGHT=400&LAYERS=dhm_kote_0_5_m,dhm_kurve_0_5_m&STYLES=&FORMAT=image/png&TRANSPARENT=FALSE</a><o:p></o:p></p>
<p class="MsoNormal"><span lang="DA">this piece of MAP file<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DA"><o:p> </o:p></span></p>
<p class="MsoNormal"> CLASS<o:p></o:p></p>
<p class="MsoNormal"> GROUP "default"<o:p></o:p></p>
<p class="MsoNormal"> NAME "dhm2015 kurver, 0,5 m"<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00 (eng. always two decimals, including .00)<o:p></o:p></p>
<p class="MsoNormal"> STYLE<o:p></o:p></p>
<p class="MsoNormal"> OPACITY 80<o:p></o:p></p>
<p class="MsoNormal"> COLOR 100 50 0<o:p></o:p></p>
<p class="MsoNormal"> WIDTH 1<o:p></o:p></p>
<p class="MsoNormal"> END #STYLE<o:p></o:p></p>
<p class="MsoNormal"> LABEL<o:p></o:p></p>
<p class="MsoNormal"> FONT "arial"<o:p></o:p></p>
<p class="MsoNormal"> SIZE 9<o:p></o:p></p>
<p class="MsoNormal"> COLOR 137 90 68<o:p></o:p></p>
<p class="MsoNormal"> OFFSET 0 -6<o:p></o:p></p>
<p class="MsoNormal"> SHADOWSIZE 1 1<o:p></o:p></p>
<p class="MsoNormal"> TYPE TRUETYPE<o:p></o:p></p>
<p class="MsoNormal"> REPEATDISTANCE 300<o:p></o:p></p>
<p class="MsoNormal"> ANGLE auto<o:p></o:p></p>
<p class="MsoNormal"> PARTIALS FALSE<o:p></o:p></p>
<p class="MsoNormal"> END # LABEL<o:p></o:p></p>
<p class="MsoNormal"> END #CLASS<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Gives me <a href="https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpasteboard.co%2FI6jsBen.png&data=02%7C01%7Csteve.lime%40state.mn.us%7Ca451b548353e4155a66d08d6ad4b8fff%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C636886937384475484&sdata=li%2BfUjy8z0PLsrF4PR%2FIcBay0iqpasi88oLNdHhhguM%3D&reserved=0">
https://pasteboard.co/I6jsBen.png</a> (contour lines w/o labels), whereas<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> CLASS<o:p></o:p></p>
<p class="MsoNormal"> GROUP "default"<o:p></o:p></p>
<p class="MsoNormal"> NAME "dhm2015 kurver, 0,5 m"<o:p></o:p></p>
<p class="MsoNormal"> #altid to decimal, også .00 (eng. always two decimals, including .00)<o:p></o:p></p>
<p class="MsoNormal"> TEXT (tostring([hoejde],"%.2f")) <o:p></o:p></p>
<p class="MsoNormal"> STYLE<o:p></o:p></p>
<p class="MsoNormal"> OPACITY 80<o:p></o:p></p>
<p class="MsoNormal"> COLOR 100 50 0<o:p></o:p></p>
<p class="MsoNormal"> WIDTH 1<o:p></o:p></p>
<p class="MsoNormal"> END #STYLE<o:p></o:p></p>
<p class="MsoNormal"> LABEL<o:p></o:p></p>
<p class="MsoNormal"> FONT "arial"<o:p></o:p></p>
<p class="MsoNormal"> SIZE 9<o:p></o:p></p>
<p class="MsoNormal"> COLOR 137 90 68<o:p></o:p></p>
<p class="MsoNormal"> OFFSET 0 -6<o:p></o:p></p>
<p class="MsoNormal"> SHADOWSIZE 1 1<o:p></o:p></p>
<p class="MsoNormal"> TYPE TRUETYPE<o:p></o:p></p>
<p class="MsoNormal"> REPEATDISTANCE 300<o:p></o:p></p>
<p class="MsoNormal"> ANGLE auto<o:p></o:p></p>
<p class="MsoNormal"> PARTIALS FALSE<o:p></o:p></p>
<p class="MsoNormal"> END # LABEL<o:p></o:p></p>
<p class="MsoNormal"> END #CLASS<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Results in <a href="https://pasteboard.co/I6js9YK.png">https://pasteboard.co/I6js9YK.png</a> (which is the desired result: Contour lines labelled with two decimal points).<o:p></o:p></p>
<p class="MsoNormal">I have narrowed it down a bit, and if I delete the “(eng. ..)”, i.e. just have<o:p></o:p></p>
<p class="MsoNormal"> TEXT (tostring([hoejde],"%.2f")) #altid to decimal, også .00<o:p></o:p></p>
<p class="MsoNormal">It still works nicely.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So I guess the parentheses are somehow parsed as something meaningful (related to the “tostring”-expression, perhaps?), invalidating the TEXT declaration.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Has anyone seen something similar?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best Regards<o:p></o:p></p>
<p class="MsoNormal">/julian<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>