Opened 18 years ago

Closed 18 years ago

#1887 closed defect (fixed)

PointSymbolizer does not use outline color correctly

Reported by: bartvde@… Owned by: assefa
Priority: high Milestone: 4.10 release
Component: WMS Server Version: 4.8
Severity: normal Keywords:
Cc:

Description

There is a bug in mapogcsld.c.

When using the following SLD:

         <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>circle</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">#FF0000</sld:CssParameter>
                  <sld:CssParameter name="fill-opacity">1.0</sld:CssParameter>
                </sld:Fill>
                <sld:Stroke>
                  <sld:CssParameter name="stroke">#000000</sld:CssParameter>
                  <sld:CssParameter name="stroke-width">1</sld:CssParameter>
                </sld:Stroke>
                                </sld:Mark>
              <sld:Size>13</sld:Size>
              <sld:Rotation>0</sld:Rotation>
            </sld:Graphic>
          </sld:PointSymbolizer>

The point ends up being coloured using the stroke color. Whereas one would
expect a stroke of 1 pixel in black, and the symbol filled in red.

This is caused by the following fragment in mapogc.sld, also for point layers it
just needs to set the outlinecolor and not the color, I have patched and tested
this in my local copy:

old code:
                                if (psColor)
                                {
                                    nLength = strlen(psColor);
                                    if (nLength == 7 && psColor[0] == '#')
                                    {
                                        /* we should set the color for point
layers since the */
                                        /* outline color is not used when  */
                                        /* rendering symbols */
                                        if (bPointLayer)
                                          msSLDSetColorObject(psColor,
                                                           &psStyle->color);
                                        else
                                          msSLDSetColorObject(psColor,
                                                             
&psStyle->outlinecolor);
                                        
                                    }
                                } 

new code:
                                if (psColor)
                                {
                                    nLength = strlen(psColor);
                                    if (nLength == 7 && psColor[0] == '#')
                                    {
                                          msSLDSetColorObject(psColor,
                                                             
&psStyle->outlinecolor);
                                        
                                    }
                                }

Change History (3)

comment:1 by bartvde@…, 18 years ago

Milestone: 4.10 release
Can this be fixed for 4.10? Seems like a 1 minute fix. Setting target to 4.10.

comment:2 by dmorissette, 18 years ago

Cc: dmorissette@… added
Owner: changed from mapserverbugs to assefa
Dunno about the fix for 4.10. Assigned to Assefa to decide since SLD is his
territory.

comment:3 by assefa, 18 years ago

Resolution: fixed
Status: newclosed
Fixed in cvs head.
Note: See TracTickets for help on using tickets.