I am trying to add a cross layer cql filter in two geoserver layers. I would like to be able to select a subgroup of the records in both layers before I apply the spatial filter.
I can apply the selection successfully in the second layer like this:
cql_filter=within(geom,collectGeometries(queryCollection('counties','geom','(county_name=''Test'')')));EXCLUDE
But I am having trouble figuring out how to get a subselection of the first layer. I tried the following but it is not working (it says: Rendering process failed. Binary geometry filter, but first expression is not a property name?):
within(collectGeometries(queryCollection('points','geom','(status=''On'')')),collectGeometries(queryCollection('counties','geom','(county_name=''Test'')')));EXCLUDE
The same error is produced when I try the following:
within(querySingle('points', 'geom', 'status=''On'''),collectGeometries(queryCollection('counties','geom','(county_name=''Test'')')));EXCLUDE
Right now, in order to get the result I want, I am using sld to filter the results of the first cql_filter, but for various reasons, it is not the best solution.
Is it possible to do this only with cql_filter? I am using geoserver 2.14.2