Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a LAYER to belong to multiple GROUPs #3237

Open
mapserver-bot opened this issue Apr 3, 2012 · 9 comments
Open

Allow a LAYER to belong to multiple GROUPs #3237

mapserver-bot opened this issue Apr 3, 2012 · 9 comments

Comments

@mapserver-bot
Copy link

Reporter: gasper
Date: 2009/12/16 - 10:05
Trac URL: http://trac.osgeo.org/mapserver/ticket/3237
I would like to define GROUP property of LAYER as a comma separated list of groups in order to define a LAYER as a part of multiple groups.

For example:


LAYER
 NAME "cities"
 GROUP "default_sat", "default_rain"
 ...
END

LAYER
 NAME "boundaries"
 GROUP "default_sat", "default_rain"
 ...
END

LAYER
 NAME "satellite"
 GROUP "default_sat"
 ...
END

LAYER
 NAME "rain"
 GROUP "default_rain"
 ...
END

So we have two "views": "default_sat" and "default_rain", where both also include "cities" and "boundaries" layers.

@mapserver-bot
Copy link
Author

Author: regodon
Date: 2010/08/13 - 10:53
I would like it too.

Meanwhile, you can accomplish what you want by setting "cities" and "boundaries" status to DEFAULT, and adding a REQUIRES "[satellite] OR [rain]" in both layers.

Regards

@ghost ghost assigned sdlime Apr 5, 2012
@mapserver-bot
Copy link
Author

This is an automated comment

This issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid.

Typically, issues fall in this state for one of the following reasons:

  • Hard, impossible or not enough information to reproduce
  • Missing test case
  • Lack of a champion with interest and/or funding to address the issue

@woodbri
Copy link

woodbri commented Jul 22, 2018

I have run into a few cases where this would be very desirable and the suggested workaround does not work for more complex cases. In my current case I have:

GROUP "all" which includes all layers that we want displayed, but we also have LAYERS roads1, roads2, roads3 and roads4 that need to be in "all" but would like to access then via GROUP "roads" and other layers like villages, government and rasters that we would like to access as individual LAYERS/GROUPS.

I can work around this by forcing the user to request LAYERS "roads1,roads2,roads3,roads4" but it would be much cleaner to only have to request LAYERS "roads". This is a simple example now multiple that be a few dozen layers and it gets messy real quick for documenting the layers to the client user.

@sdlime sdlime reopened this Jul 23, 2018
@sdlime
Copy link
Member

sdlime commented Jul 23, 2018

Reopened at the request of @woodbri. --Steve

@woodbri
Copy link

woodbri commented Jul 23, 2018

Adding some good ideas that Steve L. shared via email:

I'm not sure how big a deal this would be. One could implement as a list where you'd do:

GROUP "group1,group2"

or

GROUP "group1"
GROUP "group2"

Another idea might be to treat GROUP as an expression - it's basically just a string expression now. So you could do things like:

GROUP /./ # matches all groups
GROUP "group1"
GROUP /group1|group2/
GROUP /^roads/

I think pretty much regex or straight string expressions would be all that would make sense. This would be probably easier to implement and probably wouldn't require any changes to the MapScript API (under the hood you'd call msSetExpression()).

Some of the OWS code might be where the challenge lies, especially with GetCapabilities.

@woodbri
Copy link

woodbri commented Jul 23, 2018

My 2 cents is to keep it simple, the expressions might be nice, but I think that is where it complicates the OWS code. If we just make it a list of names (rather than an expression), then they just get added to the GetCapabilities like LAYERS and GROUP get treated now.

@yjacolin
Copy link
Contributor

Something as simple as for an user point of view is to create virtual LAYER in MapServer, something like this:

LAYER
   NAME 'group1'
   TYPE virtual
   DATA 'layer1,layer2,layer2'
END

As this, we can use METADATA block and why not, use a STYLE block to change the sub-layer's style. The style feature could be delayed later I guess :)

@sdlime
Copy link
Member

sdlime commented Jul 24, 2018 via email

@yjacolin
Copy link
Contributor

yjacolin commented Jul 25, 2018

Except that currently 2 groups can't contains the same layer as it could be, using the same example given in the first comment:

LAYER
   NAME 'default_sat'
   TYPE virtual
   DATA 'cities,boundaries,satellite'
END

LAYER
   NAME 'default_rain'
   TYPE virtual
   DATA 'cities,boundaries,rain'
END

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants