[Geoserver-users] Virtual Layers?

Experts...

I'm currently using GeoServer v1.3.2 but as far as I can tell newer versions
of GeoServer don't address this issue either.

I'm using GeoServer to create a base map layer. This layer is made up of
multiple sources of data that are enabled/disabled at different zoom levels.
This is all controlled via a SLD file. Unfortunately, I can't expose this
as a single layer in GeoServer (as far as I can tell.)

The closest I can come is to have the WMS client omit the LAYER parameter
and instead specify the SLD parameter (which is a URL to the SLD I've
created on the server.) While this works I'm not very happy with it since
the client has to know more details about the server configuration than it
should have to. (ie. the URL of the SLD file on the server). Furthermore,
this type of layer configuration doesn't seem to play well with the tile
caching spec which seems to require the LAYER parameter. At least I can't
get it to work with the TileCache (http://labs.metacarta.com/wms-c/)
implementation.

The ideal solution for me would be the ability to define a "virtual"
DataSource that simply references my SLD file (which in turn references the
other data sources). Ideally, I'd also be able mark layers as "private",
meaning they can only be referenced by local SLD files and are not exposed
directly to WMS clients.

Does this make sense or am I missing something obvious? What do other
people do that are building base layers?

Thanks,
Corey

--
View this message in context: http://www.nabble.com/Virtual-Layers--tf3061212.html#a8512386
Sent from the GeoServer - User mailing list archive at Nabble.com.

We've recently added a 'layer group' option that sounds like it might handle at least some of what you're wanting to do.

See: http://docs.codehaus.org/display/GEOSDOC/WMS+Layer-group+option

This is only available in 1.4

Note also that if you're only using TileCache then you can reference a number of layers and SLDs from it, but users will only put in the one name.

In our tilecache.cfg we have:

[sigma]
type=WMSLayer
layers=topp:poly_landmarks,topp:water_polygon,topp:water_shorelines,topp:roads,topp:major_roads,topp:states,topp:countries,topp:gnis_pop
url=http://sigma.openplans.org:8080/geoserver/wms?transparent=true
extension=png
metaTile=true

Clients will just reference 'sigma' to get the base layer that's defined by our list of layers. And you can list styles there too. And list layers multiple times each with different styles.

Though I'm not sure I'm understanding you. I'm a bit confused by the single SLD file referencing different data sources?

Chris

Yeroc wrote:

Experts...

I'm currently using GeoServer v1.3.2 but as far as I can tell newer versions
of GeoServer don't address this issue either.

I'm using GeoServer to create a base map layer. This layer is made up of
multiple sources of data that are enabled/disabled at different zoom levels. This is all controlled via a SLD file. Unfortunately, I can't expose this
as a single layer in GeoServer (as far as I can tell.)

The closest I can come is to have the WMS client omit the LAYER parameter
and instead specify the SLD parameter (which is a URL to the SLD I've
created on the server.) While this works I'm not very happy with it since
the client has to know more details about the server configuration than it
should have to. (ie. the URL of the SLD file on the server). Furthermore,
this type of layer configuration doesn't seem to play well with the tile
caching spec which seems to require the LAYER parameter. At least I can't
get it to work with the TileCache (http://labs.metacarta.com/wms-c/)
implementation.

The ideal solution for me would be the ability to define a "virtual"
DataSource that simply references my SLD file (which in turn references the
other data sources). Ideally, I'd also be able mark layers as "private",
meaning they can only be referenced by local SLD files and are not exposed
directly to WMS clients.

Does this make sense or am I missing something obvious? What do other
people do that are building base layers?

Thanks,
Corey

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Thanks for your reply. Brent also replied similarly off-list.

What I was doing under geoserver v1.3 to avoid having a big long list of layers and styles was to specify a URL like this:

http://myhost/geoserver/wms?SLD=file:/url/to/my.sld&…

In this case, neither the LAYERS or STYLES parameters are specified at all (see the SLD spec for details… the WMS spec mentions the SLD parameter but then doesn’t really document it) and instead the layer names to be rendered are defined within the SLD itself. This SLD file may define all the styles inline or may specify other styles by name. I think it’s a reasonably clean way of doing things but people don’t seem to be very aware of it as TileCache definitely doesn’t support this way of doing things.

Hope this clarifies things.

Corey

On 1/24/07, Chris Holmes <cholmes@anonymised.com> wrote:

We’ve recently added a ‘layer group’ option that sounds like it might
handle at least some of what you’re wanting to do.

See: http://docs.codehaus.org/display/GEOSDOC/WMS+Layer-group+option

This is only available in 1.4

Note also that if you’re only using TileCache then you can reference a
number of layers and SLDs from it, but users will only put in the one
name.

In our tilecache.cfg we have:

[sigma]
type=WMSLayer
layers=topp:poly_landmarks,topp:water_polygon,topp:water_shorelines,topp:roads,topp:major_roads,topp:states,topp:countries,topp:gnis_pop
url= http://sigma.openplans.org:8080/geoserver/wms?transparent=true
extension=png
metaTile=true

Clients will just reference ‘sigma’ to get the base layer that’s defined
by our list of layers. And you can list styles there too. And list
layers multiple times each with different styles.

Though I’m not sure I’m understanding you. I’m a bit confused by the
single SLD file referencing different data sources?

Chris