<div dir="ltr">Hi Steve,<div><br></div><div>I've tested your fix and it could indeed solve the problem we have encountered. Should I apply the fix in MapServer or you are willing to do that?</div><div><br></div><div>Thanks,</div><div><br></div><div>Tamas</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-30 0:04 GMT+01:00 Lime, Steve D (MNIT) <span dir="ltr"><<a href="mailto:Steve.Lime@state.mn.us" target="_blank">Steve.Lime@state.mn.us</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span style="color:#1f497d">In case anyone is interested in before/after images, I’ve included samples based on data from Tamas:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p style="margin-left:22.5pt">
<u></u><span style="color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><u></u><span style="color:#1f497d">test-before.png used git/master<u></u><u></u></span></p>
<p style="margin-left:22.5pt">
<u></u><span style="color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><u></u><span style="color:#1f497d">test-after.png used git/master but with the lines referenced below uncommented<u></u><u></u></span></p>
<p style="margin-left:22.5pt">
<u></u><span style="color:#1f497d"><span>-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><u></u><span style="color:#1f497d">test-ignore-edge-distance.png used git/master but uses a processing option to skip the label point edge distance computation<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Steve<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></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-dev [mailto:<a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Lime, Steve D (MNIT)<br>
<b>Sent:</b> Thursday, December 24, 2015 11:35 AM<br>
<b>To:</b> Tamas Szekeres <<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
<b>Subject:</b> [mapserver-dev] Thin polygon issue...<u></u><u></u></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hi Tamas: Quiet around here the day before xmas so I got time to look into this issue. I think I’ve found the problem in mapprimitive.c, the function msPolygonLabelPoint() look for two lines:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">  /* lp->y = y; */<u></u><u></u></p>
<p class="MsoNormal">  /* lp->x = x; */<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m really not sure why they were commented out but that’s the source of the issue. Try uncommenting them and drawing the data that were giving you the issue. It cleared things up for me using your test data. That’s not to say that being
 able to bypass the distance computation isn’t a good idea. That could be done as a processing option. I don’t think it’s worth being able to set the initial label point computation method (center of gravity vs bbox vs centroid) is worth it.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The next question would be where to apply this fix, it’s definitely a bug. It will change label position in instances where the fallback scanline method is used: 1) where points are too close to the edge of a polygon or 2) where the initial
 label point computation produces a point outside the polygon. That could break regression tests if we have any that trigger the scanline method. I wouldn’t think this would cause issues with tile caches.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I would propose patching 6.4, 7.0 and master and adding the distance bypass to master.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Steve<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>

</blockquote></div><br></div>