There is additional vertical offset for shield symbolizer image. To compensate this, i need to use dy="-2"
Yes trouble for me to
I'll investigate this. It almost certainly has to do something with the new text placement code.
see also MapQuest/MapQuest-Mapnik-Style#8 which might be related.
I noticed while testing 009a1e4 that the text position now matches between master and an old mapnik revision prior to the new text placement code, but the shield image is now offset by several pixels vertically.
seems there is problem and with simple TextSymbolizer placement="line", same offset of 2 pixels
discussion on this: http://mapnik.dbsgeo.com/mapnik_logs/2012/02/16/
Make ShieldSymbolizer variables doubles.
Revert "+ fix shield/text positioning - we still need to floor both t…
…ext and shield"
floor is removed from position calculation now, resulting in better marker and text matching.
This reverts commit 009a1e4.
so, @herm - do these changes fix the issue, or no?
No, it's not.
I can say nothing about the vertical positioning as the rotational issue (MapQuest/MapQuest-Mapnik-Style#8) still persists for me using the trunk build from last night. Any chance these might indeed be related?
After 9be9b09 i have additional offset from left and top (excluding already compensated 2 pixels):
So guys, it's going worst and worst? :D
Rotation issue exist if using placement='line' parameter in ShieldSymbolizer. I changed this setting to placement='point' and rotation gone. But I don't know is it right or wrong.
Yeah right, changed the placement for all shield texts to "point" instead of "line" which seems to make sense. The rotational issue is gone now. Don't know if mapnik or the mapquest style got it wrong though.
Now just the offset problems remain.
I think we need good visual tests, otherwise we cannot check regression.
I've added a test:https://github.com/mapnik/mapnik/blob/master/tests/visual_tests/shieldsymbolizer-1.xml
Looks like the text is correctly placed, but the image has an offset.
(at least for point placement. I'll check line placement later)
The problem seems to be that my new placement finder returns different starting_y values than the old version. When I set unlock-image="true" everything works.
Update: only starting_y is problematic.
Handle text position differently.
Should fix part of the ShieldSymbolizer problems.
Fix text height calculation.
still exists strange offset from left and top, strange because it is not on all shields
@ramunasd: Could you please post an example?
This is what it looks like for me now. Still some misplacement there I guess:
Shields are positioned using placement="point". I am NOT using unlock-image="true".
Looks like my testcase was not good enough. The offset seems to be only one pixel. I guess the style you are using is MapQuest's and therefore SVG shields. There should be no rounding issues with SVGs. I'll try to find this offset later today.
I'll try to add more visual tests to show current problem
Yes I am using the mapquest style.
Render ShieldSymbolizer tests with varying width. Triggers the proble…
…m in #1078.
Update script to handle case when no reference image is found.
Use double instead of int and avoid rounding when possible.
Fix ShieldSymbolizer line placement.
Refs #1078, MapQuest/MapQuest-Mapnik-Style#8.
Yeah, this case is fixed, but we still need more visual tests to prove good rendering. I see some tests fails after latest fix?
Failing tests were unrelated, but are fixed now.