0

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

gijo
  • 45
  • 4
  • First upgrade to a recent version, the look at using an and filter for the selection – Ian Turton Mar 19 '23 at 12:43
  • Can you give an example of the filter? – gijo Mar 19 '23 at 16:20
  • can you add an english description of your query? – Ian Turton Mar 24 '23 at 12:07
  • I have two layers, let's say Layer1, which is points and Layer2 which is polygons. I want to select all the points from Layer 1 which have their property status='On' and are inside the polygon with county='Test' from Layer2. – gijo Mar 25 '23 at 17:23

0 Answers0