The CQL tutorial page contains an example showing how a polygon can be used in a DISJOINT query:

DISJOINT(the_geom, POLYGON((-90 40, -90 45, -60 45, -60 40, -90 40))

What is the syntax for specifying the coordinate reference system of the POLYGON object's coordinates?

The assumption is that the polygon's coordinates are in the same CRS as the layer being queried, but I'm hoping that if the polygon's CRS can be specified, GeoServer may be able to perform the calculation on-the-fly and return a meaningful result regardless of the CRS of the layer. (Please let me know if this isn't going to work, and I need to re-project the polygon before performing the query.)

The answer at https://gis.stackexchange.com/a/29630/3112 says

call setSRS(POLYGON(...), 'EPSG:xywz')

but I can't get setSRS to work, and I can't see that listed anywhere else.

1 Answer 1


(E)CQL provides no mechanism for specifying the projection of a geometry and always assumes that it is in the same projection as the data being queried. So you will need to do the reprojection in the client.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.