Behaviour of layer groups seems inconsistent in the capabilities document. Single layer groups will sometimes have their individual layers exposed as well as the group. When added to another group, single groups will sometimes be exposed multiple times, under the correct group and in the root.
Steps to replicate with Geoserver demo data:
View the getcapabilities document without making any changes to demo data.
tasmania only appears as a group in the capabilities document. tiger-ny and spearfish both show as groups as well as exposing their individual layers.
Create a container group and add the Tasmania group to it. tasmania group appears under the container group and also under the root.
Create a second container group and add the tiger-ny group to it. tiger-ny group appears only under the container group and not in the root, correct behaviour. However all of the components of tiger-ny still show up as individual layers under the root.
Go into one of the tiger-ny layers and uncheck the Advertised box so the layer doesnât show up on itâs own, the tiger-ny group then appears under the root as well as under the container group.
Not sure what to do about this, the choice of layergroup mode should be up to the administrator (rather than enforced by the application).
I would like an easier way to configure where layer's appear in the WMS capabilities document.
The layer group "mode" is configured by the administrator, if the current behaviors are not enough, we can add more. Exposing the individual layers of a group in simple mode is by design and required by backwards compatibility, so no way we can change it, but we could create a new variant of the simple mode that hides the layer fully.
Anyways, this report should probably be closed or split into subtickets where a single bug or feature request is reported. E.g., the only bug I really see above is the tasmania group showing up both in its container and the root, but following the instructions, I cannot reproduce it.
I'd close this one and wait for a bug report that provides clear instructions to reproduce.
Got a way to reproduce it:
Here is the example with Geoserver Demo-data
Add all demo layer groups in a root "test" group
When all LayerGroups are in Container-tree mode and all Layers are Advertised the Layer list is looking good
Now LayerGroup tiger-ny is set to the Single-mode, its sub layers giant_polygon, poi, tiger_roads etc. can be seen in the layer list.
When in example giant_polygon layer is set to a not-Advertised tiger-ny LayerGroup can be seen twice in the Layer list.
Mass closing all resolved issues not modified in the last 4 weeks