[Geoserver-users] How to access remote SLD

Dear all,

I want to render my map by remote SLD so I tried to send a URL like
following (Using SLD parameter):

http://localhost/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/jpeg&BBOX=684455,1191443,686776,1192767&TRANSPARENT=false&WIDTH=690&HEIGHT=400&BGCOLOR=0xFFFFFF&EXCEPTIONS=application/vnd.ogc.se_inimage&SLD=http://www2.hcm.ciren.gov.vn/geoserver/data/styles/default_point.sld&LAYERS=webgis:hcm_ct_25000&SRS=EPSG:32648

but my map was only rendered by default style. It wasn't rendered by
SLD=http://www2.hcm.ciren.gov.vn/geoserver/data/styles/default_point.sld

What can I do know? Thank for comment !

Bui Hong Son
Deputy Chief of SCIREN
http://ciren.vn
http://www2.hcm.ciren.gov.vn/jvnwebgis

Hi,

There is currently an issue open for this.

But to make this work you must change the NamedLayer.Name element to be
the same name as the layer being requested. So like:

...
<NamedLayer>
   <Name>webgis:hcm_ct_25000</Name>
...

Then the layer should render with the specified style.

-Justin

Bui Hong Son wrote:

Dear all,

I want to render my map by remote SLD so I tried to send a URL like
following (Using SLD parameter):

http://localhost/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/jpeg&BBOX=684455,1191443,686776,1192767&TRANSPARENT=false&WIDTH=690&HEIGHT=400&BGCOLOR=0xFFFFFF&EXCEPTIONS=application/vnd.ogc.se_inimage&SLD=http://www2.hcm.ciren.gov.vn/geoserver/data/styles/default_point.sld&LAYERS=webgis:hcm_ct_25000&SRS=EPSG:32648

but my map was only rendered by default style. It wasn't rendered by
SLD=http://www2.hcm.ciren.gov.vn/geoserver/data/styles/default_point.sld

What can I do know? Thank for comment !

Bui Hong Son
Deputy Chief of SCIREN
http://ciren.vn
http://www2.hcm.ciren.gov.vn/jvnwebgis

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,46ca42ba12327180515871!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Bui Hong Son ha scritto:

Dear all,

I want to render my map by remote SLD so I tried to send a URL like
following (Using SLD parameter):

http://localhost/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/jpeg&BBOX=684455,1191443,686776,1192767&TRANSPARENT=false&WIDTH=690&HEIGHT=400&BGCOLOR=0xFFFFFF&EXCEPTIONS=application/vnd.ogc.se_inimage&SLD=http://www2.hcm.ciren.gov.vn/geoserver/data/styles/default_point.sld&LAYERS=webgis:hcm_ct_25000&SRS=EPSG:32648

but my map was only rendered by default style. It wasn't rendered by
SLD=http://www2.hcm.ciren.gov.vn/geoserver/data/styles/default_point.sld

What can I do know? Thank for comment !

Hi,
I've done some research and this is not a bug, but a part of the SLD
spec itself. From the spec:

"It has already been described, in Section 6.2, how the LAYERS and STYLES parameters
could be encoded in an SLD. The request references the SLD using a SLD parameter,
which replaces the LAYERS and STYLES parameters. The SLD itself must be accessible
to the WMS and is identified using a URL."

So, if you are using an external SLD, you should specify layer names
inside the SLD itself (in <NameLayer><Name>xxx:yyy</Name>...), and
don't include the "layers" parameter at all.

Cheers
Andrea