Given a point layer and a polygon layer (P1) in GeoServer, the following CQL Filter selects points which intersect the polygon P1:
CQL_FILTER = "Within(geom,POLYGON((P1_coordinates)))";
The resulting point features are shown in yellow in the left-hand diagram:
Given a second polygon layer (P2) which overlaps the first layer (P1), is there a CQL Filter expression which will select the points which intersect P1 but do not intersect P2? The desired result is shown in yellow in the right-hand diagram.
(In effect I want to treat P1 like a donut with P2 representing the hole, but this is not how the geometries are stored in the database).
Based on the page at http://docs.geoserver.org/latest/en/user/filter/ecql_reference.html#spatial-predicate it seems like I should be using a combination of
disjoint but I'm not sure how to string them together.