I want to query the polygon geometry and get features which are intersecting borders and within the polygon , but i am getting the features within BBOX of polygon .

my query is like this.







cql_filter:INTERSECTS(geometry,POLYGON((12.95269334858834 75.65514701171875 ,12.95269334858834 76.11107962890625 ,13.455397924014989 76.11107962890625 ,13.455397924014989 75.65514701171875 ,12.95269334858834 75.65514701171875)) )

  • Your code seems to indicate that the coordinates are in 3857, but your polygon is in 4326. Also, I think you have the coordinates reversed - if you look at it in a viewer, you get a box off the coast of Greenland. – drunkenwagoner Oct 19 '15 at 5:04
  • But after the versions they are taking coordinates in reverse only. I will try with the projection changed to 4326 – Ksrimuralikrishna Ksrimuralikr Oct 19 '15 at 6:03

I can't reproduce with the OpenGEO (Boundless) demo server http://demo.opengeo.org/geoserver/wfs.

This image shows data from feature type "ne_110m_admin_0_boundary_lines_land" and a polygon to be inserted into CQL_FILTER

enter image description here

The WFS GetFeature request made according to your request is then


And the result on a map is correct with all the linestrings inside the box and also all linestrings which are only partly inside the box.

enter image description here

Now the question is what is different in your system or data. You should prepare a complete and tested way for reproducing your issue: Which GeoServer version, which data, how to make a store and a layer from the data.

BTW. the only official output format for WFS is GML and therefore you should use that for debugging even if you finally need GeoJSON.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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