[mapserver-dev] Thin polygon issue...

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Thu Dec 24 09:35:12 PST 2015


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:

  /* lp->y = y; */
  /* lp->x = x; */

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.

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.

I would propose patching 6.4, 7.0 and master and adding the distance bypass to master.

Steve



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20151224/d10166aa/attachment.html>


More information about the mapserver-dev mailing list