#1127 closed defect (fixed)
Text sizing wrong on rotated maps.
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapServer C Library | Version: | 4.4 |
Severity: | normal | Keywords: | |
Cc: |
Description
When maps with labels are rotated the text may end up being much smaller or larger. This may relate to "SIZEUNITS" but basically the problem is that the rotation hack coordinate system is being used to derive some sort of label scaling information when that is inappropriate. I will append a map demonstrating the problem when I am able to prepare one. The original issue was raised by Flavio Hendry of Tydac AG.
Attachments (1)
Change History (5)
comment:1 by , 19 years ago
Owner: | changed from | to
---|---|
Summary: | Text sizing wrong on rotated maps. → Text sizing wrong on rotated maps. |
comment:2 by , 19 years ago
Status: | new → assigned |
---|
I have confirmed that the issue does relate to SIZEUNITS. I constructed a case without SIZEUNITS and label size was the same with or without an angle.
comment:3 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
There is a location in msPrepareImage() in mapdraw.c where scalefactor is computed. For non MS_PIXELS SIZEUNITS the calculation includes map->cellsize. However, for rotated images (or non-square WMS requests) at this point the cell size is replaced by 1.0 for the fake coordinate system used. This means the scalefactor is computed incorrectly. I have modified the code in this case to compute the cellsize from the original (saved) extents. I would add it uses the length of the cell diagonal divided by the square root of 2 as the cellsize so it will be influenced by both the x and y cellsize in non-square cases. Based on the way the cell size is computed from the map extents it seems vaguely possible that the scale factor would change a bit as the map is rotated but I am not sure about this. There was no *obvious* effect in this regard. I have committed my fix in mapserver 4.4.1 and mapserver 4.5. Please feel free to update from CVS and test. I would add that there is a similar computation in the query map generation function (msDrawQueryMap()) but I did not update this as I do not know how to excercise the query map functionality and I'm not sure the same issues apply there. I am closing this bug, but please re-open if you see the problem persists.
comment:4 by , 19 years ago
Cc: | added |
---|
Note:
See TracTickets
for help on using tickets.