[Geoserver-devel] SLD= not working when running URL

Hi,

I have a problem when trying to apply a SLD file to a GetMap request, it
ignores the SLD file and defaults to the style which is applied to the layer
through Geoserver. The request I am making is:

http://localhost:8080/geoserver/wms?request=GetMap&srs=EPSG:4326&width=1565&height=920&format=image/png&bbox=-126.325,20,-63.691,50&sld=http://localhost/MyWeb/states_style.xml&layers=topp:states

I am not sure if it is because the default style is present in the
GetCapabilities request:

<Layer queryable="1">
        <Name>topp:states</Name>
        <Title>USA Population</Title>
        <Abstract>This is some census data on the states.</Abstract>
        <KeywordList>
          <Keyword>census state boundaries united states</Keyword>
        </KeywordList>
        <SRS>EPSG:4326</SRS>
        <LatLonBoundingBox minx="-124.731422" miny="24.955967"
maxx="-66.969849" maxy="49.371735"/>
        <Style>
          <Name>population</Name>
          <Title>Population in the United States</Title>
          <Abstract>A sample filter that filters the United States into
three
            categories of population, drawn in different colors</Abstract>
          <LegendURL width="20" height="20">
            ....
          </LegendURL>
        </Style>
</Layer>

Thank you for your help,

Peter.
--
View this message in context: http://www.nabble.com/SLD%3D-not-working-when-running-URL-tf3407505.html#a9491923
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi Peter,

I can confirm this behavior. And I think it is a bug. However for now a
workaround for you can be to make the Name of the NamedLayer in your
style match the name of the layer name being queried, so in this case
your style would look like:

...
<NamedLayer>
   <Name>topp:states</Name>
   ...

I am not sure if this behavior is intentional or not, I will have to
check out the sld spec to be sure. Or perhaps someone out there already
knows.

-Justin

peterbaldwin wrote:

Hi,

I have a problem when trying to apply a SLD file to a GetMap request, it
ignores the SLD file and defaults to the style which is applied to the layer
through Geoserver. The request I am making is:

http://localhost:8080/geoserver/wms?request=GetMap&srs=EPSG:4326&width=1565&height=920&format=image/png&bbox=-126.325,20,-63.691,50&sld=http://localhost/MyWeb/states_style.xml&layers=topp:states

I am not sure if it is because the default style is present in the
GetCapabilities request:

<Layer queryable="1">
        <Name>topp:states</Name>
        <Title>USA Population</Title>
        <Abstract>This is some census data on the states.</Abstract>
        <KeywordList>
          <Keyword>census state boundaries united states</Keyword>
        </KeywordList>
        <SRS>EPSG:4326</SRS>
        <LatLonBoundingBox minx="-124.731422" miny="24.955967"
maxx="-66.969849" maxy="49.371735"/>
        <Style>
          <Name>population</Name>
          <Title>Population in the United States</Title>
          <Abstract>A sample filter that filters the United States into
three
            categories of population, drawn in different colors</Abstract>
          <LegendURL width="20" height="20">
            ....
          </LegendURL>
        </Style>
</Layer>

Thank you for your help,

Peter.

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

Justin,

Thanks for your help, that works fine now. I have created a conditional SLD
file using a XML transformation and I was worried that it wouldn't display
the updated SLD each time but it is working correctly.

Peter.

Justin Deoliveira-4 wrote:

Hi Peter,

I can confirm this behavior. And I think it is a bug. However for now a
workaround for you can be to make the Name of the NamedLayer in your
style match the name of the layer name being queried, so in this case
your style would look like:

...
<NamedLayer>
   <Name>topp:states</Name>
   ...

I am not sure if this behavior is intentional or not, I will have to
check out the sld spec to be sure. Or perhaps someone out there already
knows.

-Justin

peterbaldwin wrote:

Hi,

I have a problem when trying to apply a SLD file to a GetMap request, it
ignores the SLD file and defaults to the style which is applied to the
layer
through Geoserver. The request I am making is:

http://localhost:8080/geoserver/wms?request=GetMap&srs=EPSG:4326&width=1565&height=920&format=image/png&bbox=-126.325,20,-63.691,50&sld=http://localhost/MyWeb/states_style.xml&layers=topp:states

I am not sure if it is because the default style is present in the
GetCapabilities request:

<Layer queryable="1">
        <Name>topp:states</Name>
        <Title>USA Population</Title>
        <Abstract>This is some census data on the states.</Abstract>
        <KeywordList>
          <Keyword>census state boundaries united states</Keyword>
        </KeywordList>
        <SRS>EPSG:4326</SRS>
        <LatLonBoundingBox minx="-124.731422" miny="24.955967"
maxx="-66.969849" maxy="49.371735"/>
        <Style>
          <Name>population</Name>
          <Title>Population in the United States</Title>
          <Abstract>A sample filter that filters the United States into
three
            categories of population, drawn in different
colors</Abstract>
          <LegendURL width="20" height="20">
            ....
          </LegendURL>
        </Style>
</Layer>

Thank you for your help,

Peter.

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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
View this message in context: http://www.nabble.com/SLD%3D-not-working-when-running-URL-tf3407505.html#a9512050
Sent from the GeoServer - Dev mailing list archive at Nabble.com.