Opened 17 years ago

Closed 13 years ago

#2305 closed defect (fixed)

[SLD] external graphic and default size

Reported by: assefa Owned by: assefa
Priority: normal Milestone: 6.0 release
Component: WMS Server Version: unspecified
Severity: normal Keywords:
Cc: sdlime

Description

reported by Bart

just spent half of my day finding out why an SLD with external graphics did not work anymore with 5.0, something like:

<PointSymbolizer><Geometry><PropertyName>msGeometry</PropertyName></Geometry><Graphic><ExternalGraphic><OnlineResource '.

'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="'.$this->externalgraphic.'"/><Format>GIF</Format>'. '</ExternalGraphic><Size>1.0</Size></Graphic></PointSymbolizer></Rule>

I used a PointSymbolizer with Size 1 and this results in something like:

STYLE

ANGLE 360 COLOR 0 0 0 SIZE 1 SYMBOL "....."

END

In Mapserver 4.10 this used to draw the symbol in its native size/dimension, but in 5.0 this does not work anymore, i.e. I do not see anything in the map.

If I change Size to 17 (the size in pixels of the image used), the SLD works fine again.

Was this change intentional? Anyways, I guess this should be documented in the migration guide :-) ?

Something additional, Mapserver does not comply with the SLD spec if you omit the Size in the SLD. The SLD 1.0 spec says:

"The default size of an image format (such as GIF) is the inherent size of the image."

but Mapserver seems to use a default of 6 pixels ...

if (psSize && psSize->psChild && psSize->psChild->pszValue)

psStyle->size = atoi(psSize->psChild->pszValue);

else

psStyle->size = 6; /* defualt value */

Change History (5)

comment:1 by dmorissette, 17 years ago

Owner: changed from mapserverbugs to assefa

comment:2 by assefa, 17 years ago

Status: newassigned

The default value for marker symbols is 6pix. For external graphic symbols, if the size is ommited, we need to extract the size fro the image. Possibly modifying function msSLDGetGraphicSymbol to set the size.

comment:3 by assefa, 16 years ago

Cc: sdlime added
Milestone: 5.2 release5.4 release

For the first part of the bug, I did a quick test with 4.10.3 and I always had to set a "valid" size to be able to see a gif symbol (setting size 1 for an 8/8 gif in my map file did not produce an image). I could not also quicky see in the 4.10.x source code if that was the case. So I am not sure about this. I have cc'd Steve if he knows something about it.

Second part of the bug is still valid.

comment:4 by assefa, 15 years ago

Milestone: 5.6 release6.0 release

comment:5 by assefa, 13 years ago

Resolution: fixed
Status: assignedclosed

this should be fixed in trunk r11566.

Note: See TracTickets for help on using tickets.