Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labeling thin polygons sometimes fails. #5234

Closed
sdlime opened this issue Feb 5, 2016 · 2 comments
Closed

Labeling thin polygons sometimes fails. #5234

sdlime opened this issue Feb 5, 2016 · 2 comments
Milestone

Comments

@sdlime
Copy link
Member

@sdlime sdlime commented Feb 5, 2016

@szekerest reported instances where labeling where thin, simple polygons (think parcels) results in label points outside a polygon. It happens because a edge/distance computation in msPolygonLabelPoint() done after a center of gravity computation drops the label point computation into a second algorithm that uses scan lines to place the label. There is a bug in that second computation that can result in bad label placement.

The fix is easy, simply uncomment a couple of lines in that function, look for:

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

and the issue is resolved. In cases like this it might be even better to skip the distance check or at least make that more robust, but that's another ticket. I tried allowing a configuration via a layer processing option but since label placement is independent of layer properties it's not trivial to make that value available, especially with MapScript.

@tbonfort
Copy link
Member

@tbonfort tbonfort commented Feb 23, 2016

pull request in #5235

tbonfort added a commit to tbonfort/mapserver that referenced this issue Feb 23, 2016
tbonfort added a commit to MapServer/msautotest_DEPRECATED that referenced this issue Feb 23, 2016
tbonfort added a commit that referenced this issue Feb 23, 2016
@mapserver-bot
Copy link

@mapserver-bot mapserver-bot commented Feb 23, 2016

applied to branch-6-4 in 078a6a3 , merged into branch-7-0

@tbonfort tbonfort added this to the 7.0.1 milestone Feb 23, 2016
@tbonfort tbonfort closed this Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.