SLD param in getMap only works when NamedLayer.Name matches specied layer name with prefix included

Description

try using default_polygon.sld against states layer with the SLD paramter... it will not work unless you change the Name of the Name to topp:states. In the least it work without the prefix... and perhaps be smarter enough when there is only a single style in the sld to just use it.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 4:06 PM

CodeHaus Comment From: aaime - Time: Wed, 12 Sep 2007 06:16:24 -0500
---------------------
<p>Moving to beta4, thought I think this should be closed as "won't fix". More feebdack appreciated. Chris?</p>

codehaus
April 10, 2015, 4:06 PM

CodeHaus Comment From: aaime - Time: Wed, 10 Oct 2007 06:07:59 -0500
---------------------
<p>Looking at the specification, the "library mode" engages when SLD or SLD_BODY are used in conjuction with layers=xxx</p>

<p>In this case, the spec says (page 10):</p>

<p>"When an SLD is used as a style library, the STYLES CGI parameter is interpreted in the

usual way in the GetMap request, except that the handling of the style names is organized

so that the styles defined in the SLD take precedence over the named styles stored within

the map server. The user-defined SLD styles can be given names and they can be marked

as being the default style for a layer. To be more specific, if a style named

?CenterLine? is referenced for a layer and a style with that name is defined for the

corresponding layer in the SLD, then the SLD style definition is used. Otherwise, the

standard named-style mechanism built into the map server is used. If the use of a default

style is specified and a style is marked as being the default for the corresponding layer in

the SLD, then the default style from the SLD is used; otherwise, the standard default style

in the map server is used"</p>

<p>In fact UserStyle has a "isDefault" attribute, which we don't use in default_polygon.sld, so

according to the spec states should be rendered with its own default style since the

referenced SLD does not contain a default one.</p>

codehaus
April 10, 2015, 4:06 PM

CodeHaus Comment From: aaime - Time: Mon, 15 Oct 2007 10:55:41 -0500
---------------------
<p>Justin, going back to the initial problem, I tried the following request:</p>

<p><a href="http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&amp;styles=population&amp;Format=image/png&amp;request=GetMap&amp;layers=topp:states&amp;width=550&amp;height=250&amp;srs=EPSG:4326&amp;sld=http://localhost:8080/geoserver/styles/default_polygon.sld" class="external-link" rel="nofollow">http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&amp;styles=population&amp;Format=image/png&amp;request=GetMap&amp;layers=topp:states&amp;width=550&amp;height=250&amp;srs=EPSG:4326&amp;sld=http://localhost:8080/geoserver/styles/default_polygon.sld</a></p>

<p>and I get no exceptions. Only, the sld is ignored, which is correct when working in library mode btw, since default_polygon.sld does not contain a "default" style.

In fact the style is not even valid because it does not have a name. Yet, when I add it in the UserStyle (as "defaultPolygon", and issue the following request:

<a href="http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&amp;styles=population&amp;Format=image/png&amp;request=GetMap&amp;layers=topp:states&amp;width=550&amp;height=250&amp;srs=EPSG:4326&amp;sld=http://localhost:8080/geoserver/styles/default_polygon.sld&amp;styles=defaultPolygon" class="external-link" rel="nofollow">http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&amp;styles=population&amp;Format=image/png&amp;request=GetMap&amp;layers=topp:states&amp;width=550&amp;height=250&amp;srs=EPSG:4326&amp;sld=http://localhost:8080/geoserver/styles/default_polygon.sld&amp;styles=defaultPolygon</a></p>

<p>nothing happens, because of a bug in the code. The specification says the name of the userlayer must be used, instead the code is using the name of the userlayer/namedlayer. This is one of the two actual bugs in there. </p>

<p>The other is that nothing checks for a "default" style to be used when layers=xxx,yyy is used an not style name is provided for one of the layers (having layers=xxx,yyy engages library mode anyways).</p>

codehaus
April 10, 2015, 4:06 PM

CodeHaus Comment From: aaime - Time: Mon, 15 Oct 2007 10:56:24 -0500
---------------------
<p>This behaviour has been wrong for ages... since we are under pressure with paid work, shall we move this one to 1.6.x?</p>

codehaus
April 10, 2015, 4:06 PM

CodeHaus Comment From: cholmes - Time: Mon, 15 Oct 2007 11:06:48 -0500
---------------------
<p>sure</p>

Assignee

Unassigned

Reporter

codehaus

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure