I have only been able to find examples where geometry attributes are returned from cross layer filtering functions, but the GeoServer documentation says:

A common use case is to extract a geometry-valued attribute, and then use the value(s) in a spatial predicate against a geometry attribute in the primary layer.

Which leads me to believe that it was intended to be used to return other data.

I'm looking for examples of how that might be done in a CQL filter.

I have attempted something like this: http://localhost:8181/geoserver/test/wms?service=WMS&version=1.1.0&request=GetMap&layers=test:layer1,test:layer2&styles=&bbox=-81.54053,41.61621,-77.33826,43.41248&width=768&height=330&srs=EPSG:4326&format=application/openlayers&cql_filter=INCLUDE;property2a=querySingle('test:layer1','property1b','property1a=123')

Where only records in layer2 that have layer2.property2a = layer1.property1b are returned.

I get the exception: "Could not parse CQL filter list."

Similarly: http://localhost:8181/geoserver/test/wms?service=WMS&version=1.1.0&request=GetMap&layers=test:layer1,test:layer2&styles=&bbox=-81.54053,41.61621,-77.33826,43.41248&width=768&height=330&srs=EPSG:4326&format=application/openlayers&cql_filter=INCLUDE;property2a IN queryCollection('test:layer1','property1b','INCLUDE')

Where the values of layer2 will only be returned if layer2.property2a has a value in the returned values from layer1.property1b

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.