Hi,
I am trying to override the SLD using WMS, but I can't seem to get it to
do it.
http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&SLD=http://localhost:8080/geoserver/data/styles/densityLayerBlue.sld&Format=image/png&request=GetMap&layers=gbif:densityLayer&width=550&height=250&srs=EPSG:4326&filter=<Filter><PropertyIsEqualTo><PropertyName>path</PropertyName><Literal>http://aoraia.gbif.org/portaldev/density/taxon/13839800</Literal></PropertyIsEqualTo></Filter>&bgcolor=000000
It always returns painted using the standard SLD.
I know it is reading the new SLD as if I use a bogus URL it barfs.
My hunch is there is something about SLD I dont know...
Both my SLDs are the same except for the NamedLayer and the colours.
Could someone please advise me what I am doing wrong?
Many thanks!
Tim
The normal SLD:
<NamedLayer> <Name>densityLayer</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>densityLayer</FeatureTypeName>
<!-- 1-9 -->
<Rule>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>count</ogc:PropertyName>
<ogc:Literal>10</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#ffff00</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.9</ogc:Literal>
</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
etc...
The new SLD:
<NamedLayer> <Name>densityLayerBlue</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>densityLayer</FeatureTypeName>
<!-- 1-9 -->
<Rule>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>count</ogc:PropertyName>
<ogc:Literal>10</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#00ffff</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.9</ogc:Literal>
</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
etc...
Hi Tim,
I looked into this and it appears that the only way to get this to work
is if the Name of the of hte NamedLayer exactly matches the name of the
layer being requested. So I believe if you change
"<Name>densityLayer</Name>"
to
"<Name>gbif:densityLayer</Name>"
I think GeoServer should be smart enough to match it up without the
prefix so I am opening a jira for this one.
http://jira.codehaus.org/browse/GEOS-1298
-Justin
trobertson@anonymised.com wrote:
Hi,
I am trying to override the SLD using WMS, but I can't seem to get it to
do it.
http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&SLD=http://localhost:8080/geoserver/data/styles/densityLayerBlue.sld&Format=image/png&request=GetMap&layers=gbif:densityLayer&width=550&height=250&srs=EPSG:4326&filter=<Filter><PropertyIsEqualTo><PropertyName>path</PropertyName><Literal>http://aoraia.gbif.org/portaldev/density/taxon/13839800</Literal></PropertyIsEqualTo></Filter>&bgcolor=000000
It always returns painted using the standard SLD.
I know it is reading the new SLD as if I use a bogus URL it barfs.
My hunch is there is something about SLD I dont know...
Both my SLDs are the same except for the NamedLayer and the colours.
Could someone please advise me what I am doing wrong?
Many thanks!
Tim
The normal SLD:
<NamedLayer> <Name>densityLayer</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>densityLayer</FeatureTypeName>
<!-- 1-9 -->
<Rule>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>count</ogc:PropertyName>
<ogc:Literal>10</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#ffff00</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.9</ogc:Literal>
</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
etc...
The new SLD:
<NamedLayer> <Name>densityLayerBlue</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>densityLayer</FeatureTypeName>
<!-- 1-9 -->
<Rule>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>count</ogc:PropertyName>
<ogc:Literal>10</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#00ffff</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.9</ogc:Literal>
</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
etc...
-------------------------------------------------------------------------
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,46c82dfd10526491211187!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
Thanks
I also played around and managed to get it to work by adding that to the
SLD and only providing the SLD in the request - not the named layers.
Im still playing around and learning GIS stuff in general but this was not
the most intuitive - I would have though it was more like saying "hey
geoserver render me this layer but use this SLD instead of the default".
When I've stopped playing, I'll start implementing properly and will offer
a patch if it is keeping within the spec to ask for a named layer but a
differrent style.
Tim
Hi Tim,
I looked into this and it appears that the only way to get this to work
is if the Name of the of hte NamedLayer exactly matches the name of the
layer being requested. So I believe if you change
"<Name>densityLayer</Name>"
to
"<Name>gbif:densityLayer</Name>"
I think GeoServer should be smart enough to match it up without the
prefix so I am opening a jira for this one.
http://jira.codehaus.org/browse/GEOS-1298
-Justin
trobertson@anonymised.com wrote:
Hi,
I am trying to override the SLD using WMS, but I can't seem to get it to
do it.
http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&SLD=http://localhost:8080/geoserver/data/styles/densityLayerBlue.sld&Format=image/png&request=GetMap&layers=gbif:densityLayer&width=550&height=250&srs=EPSG:4326&filter=<Filter><PropertyIsEqualTo><PropertyName>path</PropertyName><Literal>http://aoraia.gbif.org/portaldev/density/taxon/13839800</Literal></PropertyIsEqualTo></Filter>&bgcolor=000000
It always returns painted using the standard SLD.
I know it is reading the new SLD as if I use a bogus URL it barfs.
My hunch is there is something about SLD I dont know...
Both my SLDs are the same except for the NamedLayer and the colours.
Could someone please advise me what I am doing wrong?
Many thanks!
Tim
The normal SLD:
<NamedLayer> <Name>densityLayer</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>densityLayer</FeatureTypeName>
<!-- 1-9 -->
<Rule>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>count</ogc:PropertyName>
<ogc:Literal>10</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#ffff00</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.9</ogc:Literal>
</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
etc...
The new SLD:
<NamedLayer> <Name>densityLayerBlue</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>densityLayer</FeatureTypeName>
<!-- 1-9 -->
<Rule>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>count</ogc:PropertyName>
<ogc:Literal>10</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#00ffff</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>0.9</ogc:Literal>
</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
etc...
-------------------------------------------------------------------------
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,46c82dfd10526491211187!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
trobertson@anonymised.com ha scritto:
Thanks
I also played around and managed to get it to work by adding that to the
SLD and only providing the SLD in the request - not the named layers.
Im still playing around and learning GIS stuff in general but this was not
the most intuitive - I would have though it was more like saying "hey
geoserver render me this layer but use this SLD instead of the default". When I've stopped playing, I'll start implementing properly and will offer
a patch if it is keeping within the spec to ask for a named layer but a
differrent style.
I think that's not within the spec limits. When you specify an
SLD you should provide the layers inside of it instead of using layers.
The fact you can specify a single SLD and not a list of them (one per layer) is a hint that you should not use them togheter imho. Yet, I haven't checked the SLD spec (that's where the WMS SLD extensions are specified), so I may be completely off.
Can I ask what are you trying to achieve? We may be able to provide
some hints.
Cheers
Andrea