[mapserver-dev] Thin polygon issue...

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Tue Jan 5 14:30:02 PST 2016

I was going to create a pull request against master (w/distance check skipped) to make sure this didn’t hose the regression tests first, but yes I can make that change if there are no objections.

From: Tamas Szekeres [mailto:szekerest at gmail.com]
Sent: Tuesday, January 05, 2016 8:52 AM
To: Lime, Steve D (MNIT) <Steve.Lime at state.mn.us>
Cc: mapserver-dev at lists.osgeo.org
Subject: Re: Thin polygon issue...

Hi Steve,

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?



2015-12-30 0:04 GMT+01:00 Lime, Steve D (MNIT) <Steve.Lime at state.mn.us<mailto:Steve.Lime at state.mn.us>>:
In case anyone is interested in before/after images, I’ve included samples based on data from Tamas:

-          test-before.png used git/master

-          test-after.png used git/master but with the lines referenced below uncommented

-          test-ignore-edge-distance.png used git/master but uses a processing option to skip the label point edge distance computation


From: mapserver-dev [mailto:mapserver-dev-bounces at lists.osgeo.org<mailto:mapserver-dev-bounces at lists.osgeo.org>] On Behalf Of Lime, Steve D (MNIT)
Sent: Thursday, December 24, 2015 11:35 AM
To: Tamas Szekeres <szekerest at gmail.com<mailto:szekerest at gmail.com>>
Cc: mapserver-dev at lists.osgeo.org<mailto:mapserver-dev at lists.osgeo.org>
Subject: [mapserver-dev] Thin polygon issue...

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.


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

More information about the mapserver-dev mailing list