[Geoserver-users] Best way to ask for a Layer Group (WMS protocol)

Hi,
it's me, again. :wistle:

I would appreciate suggestion on the best way to request via WMS a layer
group (of rasters).

I read that I can specify the Layer Group name in the LAYER parameter in the
GetMap Request, but how can I select single layers inthe group? Is it
possible?

(Or do I need to make a GetCapabilities request in a first place to find the
layers' name of the group and the make N GetMap requests?)

As always, thanks to all of you for the help.
Piero
--
View this message in context: http://old.nabble.com/Best-way-to-ask-for-a-Layer-Group-(WMS-protocol)-tp27950999p27950999.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Piero Campa wrote:

I would appreciate suggestion on the best way to request via WMS a
layer group (of rasters).

I read that I can specify the Layer Group name in the LAYER parameter
in the GetMap Request, but how can I select single layers inthe group?
Is it possible?

(Or do I need to make a GetCapabilities request in a first place to
find the layers' name of the group and the make N GetMap requests?)

The layers in the group will be available as any normal layer. I'm pretty sure you won't be able to find out which layers are in a layer group via the capabilities because a layer group looks like a normal layer from the outside. The layers that form part of a layer group will all be accessible as normal layers, though, assuming you know what they are called.

Regards,

Miles

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________

Miles Jordan wrote:
Piero Campa wrote:

I would appreciate suggestion on the best way to request via WMS a
layer group (of rasters).

I read that I can specify the Layer Group name in the LAYER parameter
in the GetMap Request, but how can I select single layers inthe group?
Is it possible?

(Or do I need to make a GetCapabilities request in a first place to
find the layers' name of the group and the make N GetMap requests?)

The layers in the group will be available as any normal layer. I'm pretty sure you won't be able to find out which layers are in >a layer group via the capabilities because a layer group looks like a normal layer from the outside. The layers that form part >of a layer group will all be accessible as normal layers, though, assuming you know what they are called.

Hi,

Of course you can see which layers belong to a group. Layer is a group if it has sub-layers. A sub-layer belongs to its mother layer. See an example

<Layer>
      <Name>group_name</Name>
      <Title>group_title</Title>
      <Abstract>mye_layer_group</Abstract>
      <Layer queryable="0" opaque="0" cascaded="0">
        <Name>first_layer_in_a_group</Name>
        <Title>Layer_1</Title>
        <SRS>EPSG:2393</SRS>
        <SRS>EPSG:3067</SRS>
        <SRS>EPSG:4326</SRS>
        <SRS>EPSG:900913</SRS>

...

Both the group layer and the sub-layers can be accessed by theis names. What I am missing sometimes is a possibility to hide the group members and advertise just the group. If group consists of scale dependent layers requesting individual layers does not make much sense for the user.

-Jukka Rahkonen-

Rahkonen Jukka wrote:

Miles Jordan wrote:

Piero Campa wrote:

I would appreciate suggestion on the best way to request via WMS a
layer group (of rasters).

I read that I can specify the Layer Group name in the LAYER parameter
in the GetMap Request, but how can I select single layers inthe group?
Is it possible?

(Or do I need to make a GetCapabilities request in a first place to
find the layers' name of the group and the make N GetMap requests?)

The layers in the group will be available as any normal layer. I'm
pretty sure you won't be able to find out which layers are in >a layer
group via the capabilities because a layer group looks like a normal
layer from the outside. The layers that form part >of a layer group
will all be accessible as normal layers, though, assuming you know
what they are called.

Hi,

Of course you can see which layers belong to a group. Layer is a
group if it has sub-layers. A sub-layer belongs to its mother layer.
See an example

<Layer>
      <Name>group_name</Name> <Title>group_title</Title>
      <Abstract>mye_layer_group</Abstract> <Layer queryable="0"
      opaque="0" cascaded="0">
        <Name>first_layer_in_a_group</Name> <Title>Layer_1</Title>
        <SRS>EPSG:2393</SRS> <SRS>EPSG:3067</SRS> <SRS>EPSG:4326</SRS>
        <SRS>EPSG:900913</SRS>
...

Interesting. When I get WMS capabilities from 2.0.1 I don't see that behaviour. For example I have the bluemarble coverage using the imagepyramid plugin, which is published as a layer group called "bluemarble". This is what the capabilities show:

<Layer queryable="0">
    <Name>bluemarble</Name>
    <Title>bluemarble</Title>
    <Abstract>Layer-Group type layer: bluemarble</Abstract>
    <SRS>EPSG:4326</SRS>
    <LatLonBoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0"/>
    <BoundingBox SRS="EPSG:4326" minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0"/>
</Layer>

Are you referring to GML in general or WMS capabilities (just out of interest)?

Both the group layer and the sub-layers can be accessed by theis
names. What I am missing sometimes is a possibility to hide the group
members and advertise just the group. If group consists of scale
dependent layers requesting individual layers does not make much sense
for the user.

I agree it would be really helpful to be able to hide layers.

Regards,

Miles

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________

Miles Jordan wrote:

Rahkonen Jukka wrote:
> Miles Jordan wrote:
>> Piero Campa wrote:
>>> I would appreciate suggestion on the best way to request via WMS a
>>> layer group (of rasters).
>>>
>>> I read that I can specify the Layer Group name in the
LAYER parameter
>>> in the GetMap Request, but how can I select single layers
inthe group?
>>> Is it possible?
>>>
>>> (Or do I need to make a GetCapabilities request in a
first place to
>>> find the layers' name of the group and the make N GetMap
requests?)
>>
>> The layers in the group will be available as any normal layer. I'm
>> pretty sure you won't be able to find out which layers are
in >a layer
>> group via the capabilities because a layer group looks
like a normal
>> layer from the outside. The layers that form part >of a layer group
>> will all be accessible as normal layers, though, assuming you know
>> what they are called.
>
> Hi,
>
> Of course you can see which layers belong to a group. Layer is a
> group if it has sub-layers. A sub-layer belongs to its mother layer.
> See an example
>
>
> <Layer>
> <Name>group_name</Name> <Title>group_title</Title>
> <Abstract>mye_layer_group</Abstract> <Layer queryable="0"
> opaque="0" cascaded="0">
> <Name>first_layer_in_a_group</Name> <Title>Layer_1</Title>
> <SRS>EPSG:2393</SRS> <SRS>EPSG:3067</SRS>
<SRS>EPSG:4326</SRS>
> <SRS>EPSG:900913</SRS>
> ...

Interesting. When I get WMS capabilities from 2.0.1 I don't
see that behaviour. For example I have the bluemarble
coverage using the imagepyramid plugin, which is published as
a layer group called "bluemarble". This is what the capabilities show:

<Layer queryable="0">
    <Name>bluemarble</Name>
    <Title>bluemarble</Title>
    <Abstract>Layer-Group type layer: bluemarble</Abstract>
    <SRS>EPSG:4326</SRS>
    <LatLonBoundingBox minx="-180.0" miny="-90.0"
maxx="180.0" maxy="90.0"/>
    <BoundingBox SRS="EPSG:4326" minx="-180.0" miny="-90.0"
maxx="180.0" maxy="90.0"/>
</Layer>

Are you referring to GML in general or WMS capabilities (just
out of interest)?

We may be talking about a bit different things. First, I am running WMS
with Mapserver. It should not matter, but different WMS servers do
create slightly different capabilities documents. More important may be
that your layer is made by imagepyramid plugin while I have constructed
my group by hand combining several independent raster map layers and
adjusting the minimum and maximum scales for the layers to suit the
native resolutions of source data sets.

I have never used imagepyramid plugin but I have inderstood that it
combines a bunch of original images and creates subsampled versions of
the whole layer (pyramids) so that it will be effective to browse the
layer at any scale. I do not consider it as a normal WMS group and I
cannot imagine why the different resolution levels in the pyramid should
listed in capabilities. Perhaps name "Layer-Group type layer" is a bit
misleading and some "Resolution-Pyramid type layer" would describe it
better?

> Both the group layer and the sub-layers can be accessed by theis
> names. What I am missing sometimes is a possibility to hide
the group
> members and advertise just the group. If group consists of scale
> dependent layers requesting individual layers does not make
much sense
> for the user.

I agree it would be really helpful to be able to hide layers.

However, usually the standard behaviour of WMS group is just fine. Users
can select to show the whole group, let's say "Landuse" together at
once, or select individually the real layers "agriculture", "forestry",
"residential" etc. and control the visibility however they want.

-Jukka Rahkonen-

Regards,

Miles

Some clarifications

The pyramid levels itself are not a layer. The whole set of levels creates one layer, (I can talk about the imagemosic-jdbc module and assume this holds true for the file based approach).

This holds also true for the feature pregeneralized module, which intrudes levels for vector data.

Both modules are part of geotools and AFAIK, within geotools there is no concept of layer groups.

Of course, it is possible to define one level (image/vector) as a layer shown in geoserver, but the idea of both modules is to minimize cpu and memory costs. Otherwise you have to restrict access to your levels with minScale and maxScale in your SLD (for example)

Rahkonen Jukka writes:

Miles Jordan wrote:

Rahkonen Jukka wrote:
> Miles Jordan wrote:
>> Piero Campa wrote:
>>> I would appreciate suggestion on the best way to request via WMS a
>>> layer group (of rasters).
>>>
>>> I read that I can specify the Layer Group name in the LAYER parameter
>>> in the GetMap Request, but how can I select single layers inthe group?
>>> Is it possible?
>>>
>>> (Or do I need to make a GetCapabilities request in a first place to
>>> find the layers' name of the group and the make N GetMap requests?)
>>
>> The layers in the group will be available as any normal layer. I'm
>> pretty sure you won't be able to find out which layers are in >a layer
>> group via the capabilities because a layer group looks like a normal
>> layer from the outside. The layers that form part >of a layer group
>> will all be accessible as normal layers, though, assuming you know
>> what they are called.
>
> Hi,
>
> Of course you can see which layers belong to a group. Layer is a
> group if it has sub-layers. A sub-layer belongs to its mother layer.
> See an example
>
> <Layer>
> <Name>group_name</Name> <Title>group_title</Title>
> <Abstract>mye_layer_group</Abstract> <Layer queryable="0"
> opaque="0" cascaded="0">
> <Name>first_layer_in_a_group</Name> <Title>Layer_1</Title>
> <SRS>EPSG:2393</SRS> <SRS>EPSG:3067</SRS> <SRS>EPSG:4326</SRS>
> <SRS>EPSG:900913</SRS>
> ...

Interesting. When I get WMS capabilities from 2.0.1 I don't see that behaviour. For example I have the bluemarble coverage using the imagepyramid plugin, which is published as a layer group called "bluemarble". This is what the capabilities show:

<Layer queryable="0">
    <Name>bluemarble</Name>
    <Title>bluemarble</Title>
    <Abstract>Layer-Group type layer: bluemarble</Abstract>
    <SRS>EPSG:4326</SRS>
    <LatLonBoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0"/>
    <BoundingBox SRS="EPSG:4326" minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0"/>
</Layer>

Are you referring to GML in general or WMS capabilities (just out of interest)?

We may be talking about a bit different things. First, I am running WMS
with Mapserver. It should not matter, but different WMS servers do
create slightly different capabilities documents. More important may be
that your layer is made by imagepyramid plugin while I have constructed
my group by hand combining several independent raster map layers and
adjusting the minimum and maximum scales for the layers to suit the
native resolutions of source data sets.

I have never used imagepyramid plugin but I have inderstood that it
combines a bunch of original images and creates subsampled versions of
the whole layer (pyramids) so that it will be effective to browse the
layer at any scale. I do not consider it as a normal WMS group and I
cannot imagine why the different resolution levels in the pyramid should
listed in capabilities. Perhaps name "Layer-Group type layer" is a bit
misleading and some "Resolution-Pyramid type layer" would describe it
better?

> Both the group layer and the sub-layers can be accessed by theis
> names. What I am missing sometimes is a possibility to hide the group
> members and advertise just the group. If group consists of scale
> dependent layers requesting individual layers does not make much sense
> for the user.

I agree it would be really helpful to be able to hide layers.

However, usually the standard behaviour of WMS group is just fine. Users
can select to show the whole group, let's say "Landuse" together at
once, or select individually the real layers "agriculture", "forestry",
"residential" etc. and control the visibility however they want.

-Jukka Rahkonen-

Regards,

Miles

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Piero Campa ha scritto:

Hi, it's me, again. :wistle:

I would appreciate suggestion on the best way to request via WMS a layer
group (of rasters).

I read that I can specify the Layer Group name in the LAYER parameter in the
GetMap Request, but how can I select single layers inthe group? Is it
possible?

(Or do I need to make a GetCapabilities request in a first place to find the
layers' name of the group and the make N GetMap requests?)

I see there is some confusion in the thread, I'm going to try and clarify.

In GeoServer a "Layer Group" is pure syntactic sugar, the layer group
name gets expanded into its component the very moment the request
gets parsed. The group is represented as a single layer with no
nesting, and all the layers inside the group have to be published
as well. So it's just a handy way to create a base layer, nothing
less, nothing more.

What Jukka is referring we could call layer nesting, and it's available
using the "wms path" option in the layer configuration.
As far as I know it's not very much used and could be buggy.
Given the flexibility of the new UI it would be nice to have
a visual tree builder for the WMS caps document, but that's something
for the future (any takers? :-p )
In any case, this is completely unrelated to the layer group concept
in GeoServer.

As for pyramids, both file based and jdbc based ones are not groups,
they do publish a single layer whose internal structure it completely
hidden to the user and used solely for performance reasons.

Hope this helps to clarify things a bit

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Thank you for the answers.
I think my question was not that clear, sorry for that.

What I am doing is asking for a layer group via WMS: I would place every
Geoserver-layer of that group in a different OpenLayers-layer in a map.
I do not ask for the layers directly, because I don't know in advance the
title of the single layers, but I know the title of the group they are in.

Piero

(I'm supposing it is not possible to filter the request of WMS layers on the
layer-name, something like wild cards)

Andrea Aime-4 wrote:

Piero Campa ha scritto:

Hi,
it's me, again. :wistle:

I would appreciate suggestion on the best way to request via WMS a layer
group (of rasters).

I read that I can specify the Layer Group name in the LAYER parameter in
the
GetMap Request, but how can I select single layers inthe group? Is it
possible?

(Or do I need to make a GetCapabilities request in a first place to find
the
layers' name of the group and the make N GetMap requests?)

I see there is some confusion in the thread, I'm going to try and clarify.

In GeoServer a "Layer Group" is pure syntactic sugar, the layer group
name gets expanded into its component the very moment the request
gets parsed. The group is represented as a single layer with no
nesting, and all the layers inside the group have to be published
as well. So it's just a handy way to create a base layer, nothing
less, nothing more.

What Jukka is referring we could call layer nesting, and it's available
using the "wms path" option in the layer configuration.
As far as I know it's not very much used and could be buggy.
Given the flexibility of the new UI it would be nice to have
a visual tree builder for the WMS caps document, but that's something
for the future (any takers? :-p )
In any case, this is completely unrelated to the layer group concept
in GeoServer.

As for pyramids, both file based and jdbc based ones are not groups,
they do publish a single layer whose internal structure it completely
hidden to the user and used solely for performance reasons.

Hope this helps to clarify things a bit

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://old.nabble.com/Best-way-to-ask-for-a-Layer-Group-(WMS-protocol)-tp27950999p27988468.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Andrea Aime-4 wrote:

In GeoServer a "Layer Group" is pure syntactic sugar, the layer group
name gets expanded into its component the very moment the request gets
parsed. The group is represented as a single layer with no nesting, and
all the layers inside the group have to be published as well. So it's
just a handy way to create a base layer, nothing less, nothing more.

What Jukka is referring we could call layer nesting, and it's available
using the "wms path" option in the layer configuration. As far as I
know it's not very much used and could be buggy. Given the flexibility
of the new UI it would be nice to have a visual tree builder for the
WMS caps document, but that's something for the future (any takers? :-p
) In any case, this is completely unrelated to the layer group concept
in GeoServer.

As for pyramids, both file based and jdbc based ones are not groups,
they do publish a single layer whose internal structure it completely
hidden to the user and used solely for performance reasons.

I think I may have confused things a little by mentioning the pyramids. What I meant was that I had set up the bluemarble pyramids as per the documentation at http://geoserver.org/display/GEOSDOC/Load+NASA+Blue+Marble+Data which uses a layer group as suggested at the bottom of the page.

It was the only example I had of using a layer group, but it is still a valid one! Sorry for the confusion.

Piero Campa wrote:

Thank you for the answers.
I think my question was not that clear, sorry for that.

What I am doing is asking for a layer group via WMS: I would place
every Geoserver-layer of that group in a different OpenLayers-layer in
a map.
I do not ask for the layers directly, because I don't know in advance
the title of the single layers, but I know the title of the group they
are in.

Piero

(I'm supposing it is not possible to filter the request of WMS layers
on the layer-name, something like wild cards)

Piero, the functionality that you are looking for really sounds like a client-side feature, and AFAIK openlayers doesn't come with that kind of thing. You would have to build it into your application. So to do that your application will have to query the capabilities document and pull out the layers based on your wildcard search. Then you can add those layers to your openlayers map.

I hope that provides you with a better answer!

Regards,

Miles

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________

Yes Andrea, thank you, I was pretty sure I couldn't do a thing like that but
I wanted to be sure.

I've been thinking too about looking in the Get Capabilities in order to get
the name of the layers in the group, but I can see that they don't list the
layers of a group, but just the group name:

<Layer queryable="0">
<Name>myLayerGroup</Name>
<Title>myLayerGroup</Title>
<Abstract>Layer-Group type layer: etc...</Abstract>
<SRS>EPSG:32631</SRS>
<LatLonBoundingBox minx="-29.769573401953732" miny="27.34128043838873"
maxx="47.32071451329014" maxy="67.44831007697901"/>
<BoundingBox SRS="EPSG:32631" minx="-1064282.291" miny="3573468.632"
maxx="4091632.972" maxy="7485848.545"/>
</Layer>

(this is the request:
http://localhost:8080/geoserver/wms?service=WMS&version=1.1.1&request=GetCapabilities)

Piero

Miles Jordan wrote:

Andrea Aime-4 wrote:

In GeoServer a "Layer Group" is pure syntactic sugar, the layer group
name gets expanded into its component the very moment the request gets
parsed. The group is represented as a single layer with no nesting, and
all the layers inside the group have to be published as well. So it's
just a handy way to create a base layer, nothing less, nothing more.

What Jukka is referring we could call layer nesting, and it's available
using the "wms path" option in the layer configuration. As far as I
know it's not very much used and could be buggy. Given the flexibility
of the new UI it would be nice to have a visual tree builder for the
WMS caps document, but that's something for the future (any takers? :-p
) In any case, this is completely unrelated to the layer group concept
in GeoServer.

As for pyramids, both file based and jdbc based ones are not groups,
they do publish a single layer whose internal structure it completely
hidden to the user and used solely for performance reasons.

I think I may have confused things a little by mentioning the pyramids.
What I meant was that I had set up the bluemarble pyramids as per the
documentation at
http://geoserver.org/display/GEOSDOC/Load+NASA+Blue+Marble+Data which uses
a layer group as suggested at the bottom of the page.

It was the only example I had of using a layer group, but it is still a
valid one! Sorry for the confusion.

Piero Campa wrote:

Thank you for the answers.
I think my question was not that clear, sorry for that.

What I am doing is asking for a layer group via WMS: I would place
every Geoserver-layer of that group in a different OpenLayers-layer in
a map.
I do not ask for the layers directly, because I don't know in advance
the title of the single layers, but I know the title of the group they
are in.

Piero

(I'm supposing it is not possible to filter the request of WMS layers
on the layer-name, something like wild cards)

Piero, the functionality that you are looking for really sounds like a
client-side feature, and AFAIK openlayers doesn't come with that kind of
thing. You would have to build it into your application. So to do that
your application will have to query the capabilities document and pull out
the layers based on your wildcard search. Then you can add those layers to
your openlayers map.

I hope that provides you with a better answer!

Regards,

Miles

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you
are not the
intended recipient, you are notified that use or dissemination of this
communication is
strictly prohibited by Commonwealth law. If you have received this
transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3
6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://old.nabble.com/Best-way-to-ask-for-a-Layer-Group-(WMS-protocol)-tp27950999p27998300.html
Sent from the GeoServer - User mailing list archive at Nabble.com.