I have a WMS that I need to filter with CQL_FILTER parameter using an array of srting IDs.
The layer is published from a PostGIS Table View which is declared like so:
create view mob.daily_origin_all
as select "date", "start", "end", id, inc, totinc, diaginc, offdiaginc, mob.calculateSignalLevel(inc) as "level", country, wkb_geometry as geom from
(select "date", "start", "end", origin as id, sum(inc) inc, avg(totinc) totinc, avg(diaginc) diaginc, avg(offdiaginc) offdiaginc, max(country) country
from mob.signals
where freq = 'daily'
group by "date", "start", "end", origin) as dlorgall,
mob.geo
where zone_id = dlorgall.id;
In the GeoServer Layer Preview page, I can try to apply a CQL_FILTER parameter.
Supposing the id
I am looking for is XXX
, when I do id = 'XXX'
I receive the correct response and can visualize the area I need in the map.
However, when I try with id IN ('XXX')
, I receive an empty image. So, it seems the request is correct but the result is empty, when it should be equal to the one given by id = 'XXX'
.
I also looked at this other question, but it did not help apparently.
And, when I look at the GeoServer log, I see this warning:
WARNING: ID IN (...) is a deprecated syntax, you should use IN (...)
So I am guessing this is a matter of naming the column differently than id
. But why should it work in one way and not the other?