I am using GetFeatureInfo query to WMS service. When I click a WMS object on the map, the response is coming.


But I want to send a request a polygonal area. Not a single x,y location. How can I do this? Is possible?

3 Answers 3


You can only use a x,y (i,j) coordinate search for GetFeatureInfo requests http://docs.geoserver.org/stable/en/user/services/wms/reference.html#getfeatureinfo

However, you may test for interactions with polygons (and many other geometries) using a Web Feature Service (WFS) request.

E.g. https://wiki.state.ma.us/confluence/display/massgis/GeoServer+-+WFS+-+Get+Feature+by+Polygon+-+Other+Projection


Usually a request for features is done on a featureservice (WFS) - esp. when you have a more complex logic like querying features within a given polygon. The GetFeatureInfo is designed to perform a feature-query based on the mouse-position in native (meaning display-) coordinates rather the geographic (transformed) coords. But it is indeed restricted to that single position (don´t get irritated: the BBOX param is the parameter for the map-size itself, it has nothing to do with your actual feature-query). If you have a GeoServer you may have a look at WMS reference also, but also if you don´t (the site deals for WebServices in general, no matter if GeoServer or not).


With Geoserver you might want to have a try with the CQL filters which are much easier to write than the official OGC style XML/GML filters.

I took the "DISJOINT" example from the manual http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html and converted into WFS GetFeature request with INTERSECTS filter. You can test it with the demo server of Boundless with this request

http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.0.0&request=getfeature&typename=topp:states&CQL_FILTER=INTERSECTS(the_geom, POLYGON((-90 40, -90 45, -60 45, -60 40, -90 40)))

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.