0

I have a base layer and a point layer defined in GeoServer, let's call them LayerBase and LayerPoint. I want to see one rendered on top of the other. So I created a Layer Group, let's call it LayerGroup.

It renders just fine, putting the points on top of the base.

Now I want to filter which points get displayed with CQL. When I tried the same filter I use with the point layer by itself, I get errors because it also tries to filter the base layer using the same attributes, which are not in that layer.

I read that you can supply CQL for each layer separated by a semicolon, and that the "INCLUDE" keyword means no filtering of that layer. Sure enough, I entered the filter as "INCLUDE;PointAttribute='value'" and it almost worked.

While I don't get any more errors, the second layer is NOT being filtered. I'm using the built in preview to enter the CQL for testing. I even changed the second part of the cql to filter on a dummy attribute, which should have caused an error, but it is just ignoring this second part of the CQL.

Perhaps this doesn't work this way with a layer group? Perhaps I have to actually include both layers individually? In which case I cannot use the built in previewer and enter CQL to filter just one layer.

If that's the case, I'll just write a quick previewer myself, not something I wanted to do, but that could work. Or has someone already invented one that I don't know about?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.