[Geoserver-users] Layer Group and remote SLD (url)

Hi all

I created a layer group (country) that joins 27 features (states) and named it “mycountry”.
Those features have some atributes (like “state_code” and “name”) that are common to all of them.
Then I tested it throught GetMap request and it worked fine , using the features default styles (that are the same for all of them too).
The problem is that when I try to display the same group but using a remote SLD throught an url I get no image or better , in fact I get some frames (once I am using OpenLayers) with the “red cross” that says it could not load the image(s).
So I have couple questions: Is it possible to call a remote SLD even when using a Layer group ? If so: Is that SLD description applicable to all the features that are part of such group ?

Thanks in advance

Fernando.

Luis F Silva ha scritto:

Hi all

I created a layer group (country) that joins 27 features (states) and named it "mycountry".
Those features have some atributes (like "state_code" and "name") that are common to all of them.
Then I tested it throught GetMap request and it worked fine , using the features default styles (that are the same for all of them too).
The problem is that when I try to display the same group but using a remote SLD throught an url I get no image or better , in fact I get some frames (once I am using OpenLayers) with the "red cross" that says it could not load the image(s).
So I have couple questions: Is it possible to call a remote SLD even when using a Layer group ? If so: Is that SLD description applicable to all the features that are part of such group ?

A layer group is something that is expanded server side into a list
of layers and styles, so the actual WMS renderer does not see it at all.

The issue is, when you specify a remote SLD to use, that's basically
replaces layers and styles parameters. It's not like you can specify
just the styles in that document, you have to re-specify everything,
and there layer grouping does not work at all.

If you need to perform filtering I suggest you use our custom WMS
extensions for filtering, adding either an OGC filter or a CQL
filter to the request. If you specify just one filter, it should
work just fine (it will be applied to all layers).
For more information, see:
http://docs.codehaus.org/display/GEOSDOC/WMS+vendor+parameters

Hope this helps
Cheers
Andrea

Andrea

Thank you very much for your response.
I think I understood the limitations of my idea.
Let me ask you another question: I have an SLD (described right below) where the only layer (in fact the layer group) “country” is mentioned with some rules and filters.
That SLD is generated on the fly , according to the user’s needs and couple selected options , and may become much greater than the one showed below , that’s why it is served from a remote servlet throught an url.
The whole thing is between the … tags and so I would like to know if there is a way to have , in an SLD , many layers mentioned but with just one set of rules, filters, symbolizers and so on.
It may solve my problem , once I could code the 27 states as layers and just one collection of rules and filters , to avoid having SLDs with large sizes.

This is one example of my SLD:

country UserSelection STATECODE 33 #5F9EA0 NAME Arial Normal 8 #000000 0.5 0 #000000 1

Thanks again

Fernando.

Andrea Aime aaime@anonymised.com

04/10/2007 13:41

To
Luis F Silva lfsilva@anonymised.com

cc
geoserver-users@lists.sourceforge.net

Subject
Re: [Geoserver-users] Layer Group and remote SLD (url)

Luis F Silva ha scritto:
>
> Hi all
>
> I created a layer group (country) that joins 27 features (states) and
> named it "mycountry".
> Those features have some atributes (like "state_code" and "name") that
> are common to all of them.
> Then I tested it throught GetMap request and it worked fine , using the
> features default styles (that are the same for all of them too).
> The problem is that when I try to display the same group but using a
> remote SLD throught an url I get no image or better , in fact I get some
> frames (once I am using OpenLayers) with the "red cross" that says it
> could not load the image(s).
> So I have couple questions: Is it possible to call a remote SLD even
> when using a Layer group ? If so: Is that SLD description applicable to
> all the features that are part of such group ?

A layer group is something that is expanded server side into a list
of layers and styles, so the actual WMS renderer does not see it at all.

The issue is, when you specify a remote SLD to use, that's basically
replaces layers and styles parameters. It's not like you can specify
just the styles in that document, you have to re-specify everything,
and there layer grouping does not work at all.

If you need to perform filtering I suggest you use our custom WMS
extensions for filtering, adding either an OGC filter or a CQL
filter to the request. If you specify just one filter, it should
work just fine (it will be applied to all layers).
For more information, see:
http://docs.codehaus.org/display/GEOSDOC/WMS+vendor+parameters

Hope this helps
Cheers
Andrea

Luis F Silva ha scritto:

Andrea

Thank you very much for your response.
I think I understood the limitations of my idea.
Let me ask you another question: I have an SLD (described right below) where the only layer (in fact the layer group) "country" is mentioned with some rules and filters.
That SLD is generated on the fly , according to the user's needs and couple selected options , and may become much greater than the one showed below , that's why it is served from a remote servlet throught an url.
The whole thing is between the <NamedLayer>....</NamedLayer> tags and so I would like to know if there is a way to have , in an SLD , many layers mentioned but with just one set of rules, filters, symbolizers and so on.
It may solve my problem , once I could code the 27 states as layers and just one collection of rules and filters , to avoid having SLDs with large sizes.

You cannot use grouped layers in an SLD, I'm sorry, but it goes against
the very nature of an SLD.
In SLD each rules referers a specific FeatureType, whilst a group
is a typeless layer that has to be used as is.
So if you really need to use an external SLD, you'll be bound to
generate a big one with all 27 layers specified.

Cheers
Andrea

Andrea

Thanks for your response and information.
The problem is that I need to specify the fill color of the polygons and it do not seem that the WMS extensions for filtering will allow me to do it.
Am I right ?

Thanks in advance

Fernando.

Andrea Aime aaime@anonymised.com

04/10/2007 13:41

To
Luis F Silva lfsilva@anonymised.com

cc
geoserver-users@lists.sourceforge.net

Subject
Re: [Geoserver-users] Layer Group and remote SLD (url)

Luis F Silva ha scritto:
>
> Hi all
>
> I created a layer group (country) that joins 27 features (states) and
> named it "mycountry".
> Those features have some atributes (like "state_code" and "name") that
> are common to all of them.
> Then I tested it throught GetMap request and it worked fine , using the
> features default styles (that are the same for all of them too).
> The problem is that when I try to display the same group but using a
> remote SLD throught an url I get no image or better , in fact I get some
> frames (once I am using OpenLayers) with the "red cross" that says it
> could not load the image(s).
> So I have couple questions: Is it possible to call a remote SLD even
> when using a Layer group ? If so: Is that SLD description applicable to
> all the features that are part of such group ?

A layer group is something that is expanded server side into a list
of layers and styles, so the actual WMS renderer does not see it at all.

The issue is, when you specify a remote SLD to use, that's basically
replaces layers and styles parameters. It's not like you can specify
just the styles in that document, you have to re-specify everything,
and there layer grouping does not work at all.

If you need to perform filtering I suggest you use our custom WMS
extensions for filtering, adding either an OGC filter or a CQL
filter to the request. If you specify just one filter, it should
work just fine (it will be applied to all layers).
For more information, see:
http://docs.codehaus.org/display/GEOSDOC/WMS+vendor+parameters

Hope this helps
Cheers
Andrea

Luis F Silva ha scritto:

Andrea

Thanks for your response and information.
The problem is that I need to specify the fill color of the polygons and it do not seem that the WMS extensions for filtering will allow me to do it.
Am I right ?

You are right indeed. You'll need to build the big sld in that case...
Cheers
Andrea