[Geoserver-users] GeoServer 2.1-RC4 ignoring remote SLD

Hi all,

I try to request a map from GeoServer with a remote SLD.

http://www.server.net/geoserver/wms?LAYERS=prj:hydro_snowcoverdays&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SLD=http://www.server.net/prj/styles/hydro_snowcoverdays_template.sld&FORMAT=image/jpeg&SRS=EPSG:2393&BBOX=2325000.0732421,6275000.0732422,4274999.9267578,8224999.9267578&WIDTH=450&HEIGHT=450&TILED=false

GeoServer ignores the SLD definition and uses always the default style defined. The same happens if I give the SLD in the SLD_BODY parameter. If the SLD given is invalid GeoServer returns a correct error message.

The log file says that the remote SLD is used first.

011-04-18 11:19:23,129 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('\
<') 3F ('?') 78 ('x') 6D ('m')
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred \
encoding: UTF-8
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - Charset detection phase 2. Charset i\
n XML declaration is `UTF-8`.
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - Trying to create reader basing on ex\
isting charset information: `UTF-8`.
2011-04-18 11:19:23,132 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,132 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,132 TRACE [geotools.styling] - ENTRY
2011-04-18 11:19:23,132 DEBUG [geotools.styling] - number of fts set 1
2011-04-18 11:19:23,134 DEBUG [geoserver.wms] - setting up map
2011-04-18 11:19:23,134 DEBUG [wms.map] - setting up 450x450 image

After that it seems that GeoServer is creating the styling with the default style (my remote SLD hasn't filters).

2011-04-18 11:19:23,134 DEBUG [geotools.styling] - number of fts set 1
2011-04-18 11:19:23,135 DEBUG [geotools.rendering] - Computed scale denominator: 1.547618\
9313616667E7
2011-04-18 11:19:23,136 DEBUG [geotools.styling] - number of fts set 1
2011-04-18 11:19:23,136 DEBUG [geotools.rendering] - processing 1 stylers for http://www.\
ilmasto-opas.fi:hydro_snowcoverdays
2011-04-18 11:19:23,136 DEBUG [geotools.rendering] - creating rules for scale denominator\
- 15,476,189.314
2011-04-18 11:19:23,136 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,136 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,136 TRACE [geotools.styling] - ENTRY
...
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting PropertyName
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LiteralExpression
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting NullFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting PropertyName
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting SQL ComparisonFilter

I updated the GeoServer to the version 2.1-RC4 recently. Remote SLDs work correctly with the layers that I have created with the older version of GeoServer (2.0.2).

If this was a bug in 2.1-RC4 I think that someone would have noticed it. So what could be wrong?

--
Ismo Lahtinen

Maybe I'm really the only one having this problem. :slight_smile:

I'll try to formulate more specific report later this week if no one hasn't any good tip what could be wrong.

--
Ismo Lahtinen

-----Alkuperäinen viesti-----
Lähettäjä: Lahtinen Ismo
Lähetetty: 18. huhtikuuta 2011 12:51
Vastaanottaja: 'geoserver-users@lists.sourceforge.net'
Aihe: GeoServer 2.1-RC4 ignoring remote SLD

Hi all,

I try to request a map from GeoServer with a remote SLD.

http://www.server.net/geoserver/wms?LAYERS=prj:hydro_snowcoverdays&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SLD=http://www.server.net/prj/styles/hydro_snowcoverdays_template.sld&FORMAT=image/jpeg&SRS=EPSG:2393&BBOX=2325000.0732421,6275000.0732422,4274999.9267578,8224999.9267578&WIDTH=450&HEIGHT=450&TILED=false

GeoServer ignores the SLD definition and uses always the default style defined. The same happens if I give the SLD in the SLD_BODY parameter. If the SLD given is invalid GeoServer returns a correct error message.

The log file says that the remote SLD is used first.

011-04-18 11:19:23,129 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('\
<') 3F ('?') 78 ('x') 6D ('m')
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred \
encoding: UTF-8
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - Charset detection phase 2. Charset i\ n XML declaration is `UTF-8`.
2011-04-18 11:19:23,130 DEBUG [geoserver.requests] - Trying to create reader basing on ex\ isting charset information: `UTF-8`.
2011-04-18 11:19:23,132 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,132 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,132 TRACE [geotools.styling] - ENTRY
2011-04-18 11:19:23,132 DEBUG [geotools.styling] - number of fts set 1
2011-04-18 11:19:23,134 DEBUG [geoserver.wms] - setting up map
2011-04-18 11:19:23,134 DEBUG [wms.map] - setting up 450x450 image

After that it seems that GeoServer is creating the styling with the default style (my remote SLD hasn't filters).

2011-04-18 11:19:23,134 DEBUG [geotools.styling] - number of fts set 1
2011-04-18 11:19:23,135 DEBUG [geotools.rendering] - Computed scale denominator: 1.547618\
9313616667E7
2011-04-18 11:19:23,136 DEBUG [geotools.styling] - number of fts set 1
2011-04-18 11:19:23,136 DEBUG [geotools.rendering] - processing 1 stylers for http://www.\ ilmasto-opas.fi:hydro_snowcoverdays
2011-04-18 11:19:23,136 DEBUG [geotools.rendering] - creating rules for scale denominator\
- 15,476,189.314
2011-04-18 11:19:23,136 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,136 DEBUG [geotools.styling] - creating defaultMark
2011-04-18 11:19:23,136 TRACE [geotools.styling] - ENTRY ...
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting PropertyName
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LiteralExpression
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting LogicFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting NullFilter
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting PropertyName
2011-04-18 11:19:23,144 DEBUG [geotools.filter] - exporting SQL ComparisonFilter

I updated the GeoServer to the version 2.1-RC4 recently. Remote SLDs work correctly with the layers that I have created with the older version of GeoServer (2.0.2).

If this was a bug in 2.1-RC4 I think that someone would have noticed it. So what could be wrong?

--
Ismo Lahtinen

On Mon, Apr 18, 2011 at 11:51 AM, Lahtinen Ismo
<Ismo.Lahtinen@anonymised.com> wrote:

Hi all,

I try to request a map from GeoServer with a remote SLD.

http://www.server.net/geoserver/wms?LAYERS=prj:hydro_snowcoverdays&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SLD=http://www.server.net/prj/styles/hydro_snowcoverdays_template.sld&FORMAT=image/jpeg&SRS=EPSG:2393&BBOX=2325000.0732421,6275000.0732422,4274999.9267578,8224999.9267578&WIDTH=450&HEIGHT=450&TILED=false

You are specifying LAYERS, STYLES and SLD in the same request, this is
known as "library mode".
The code will search in the SLD for a style associated to the
prj:hydro_snowcoverdays NamedLayer which is also
marked as the default one, if it's not found it will fall back on the
server default style for that layer

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------