GetMap throws exception when using featureid filter against multiple layers


When calling a single layer (e.g. foo) via a WMS call you can filter the layer with the featureid=foo.X

However if you make the same call with an additional layer (e.g. bar) calling featureid=foo.X results in an error.

Error Message
'Layers and filters are mismatched, you need to provide one filter for each layer'

Ticket being raise following advice from Andrea Aime

I'm trying to make a WMS call to geoserver which will create an image containing 2 layers foo & bar (foo is a layer group); however bar should be filtered based on featureid.

When I only load a single layer (e.g. bar) - I can use the filter method &featureid=bar.1 but this same method doesn't work when you try to load multiple layers (e.g. foo & bar).

Single Layer Filter

When I run:

I get an error say that both layers need to be filtered. Any ideas on how to load multiple layers but only filter 1?


Ubuntu 16.04 & Windows Server 2008 R2


Jody Garnett
August 28, 2016, 8:53 AM

Can you accomplish the same thing using cql_filter?

The order of the filters needs to match the order of the layers drawn, so your "foo" layer would be the first filter, and the subsequent filters would need to match the layers in your layer group...

You can use IN ('river.1', 'river.2') to match multiple feature ids in a single layer.

Andrea Aime
September 30, 2016, 4:32 PM

What you are reporting is a bug, as it should not be erroring out, but the WFS specification from where featureid comes mandates that only the features matching the filter, from any layer, should be returned. So once fixed only the single feature you selected will be painted, and none from the other layers...

Andrea Aime
February 15, 2017, 11:47 AM

Mass closing all resolved issues not modified in the last 4 weeks



Andrea Aime


hugh loughrey



Fix versions

Affects versions