I would like to know if it is possible to get the bounding box from a geometry returned by a WFS service. An example of WFS feature request:


I am trying to create a simple web app that helps users without a GIS build valid WMS GetMap requests to generate maps of protected sites from my country.

The services are INSPIRE-compliant, the view service is a WMS Service (published from ArcGIS), and the data service is a WFS Service (published from GOPublisher).

Ideally I would like my users to select the criteria for generating a static map of the data, pass this filter to the WFS service, compute the bounding box of the data in question, and pass this bounding box as a parameter in the WMS GetMap requests.

I have read that JQuery has some XML parsing support, but maybe someone here can recommend a library/method that is more GIS?

  • Hi Sorin, nice question. Just wondering whether you could create a stored query on Snowflake to answer your Get BBOX for Feature ID question, rather than trying to somehow parse the response on the client to get the same answer.
    – nmtoken
    Commented Jan 14, 2016 at 10:57

1 Answer 1


An example of a geoserver layer WFS bbox request would go something like this:


  • I know that you can manually specify a bounding box to spatially filter the data. What I want is to query a WFS service, with a syntex simiar to "featureid=ROSCI0065", receive the corresponding geometry, and then get the geometry's bounding box.
    – Sorin RUSU
    Commented Jan 13, 2016 at 13:24
  • 1
    Because GML from that WFS server does not seem to include the BoundingBox element you must read the geometry into your application and find the bounding box or "envelope" with your application. If is is using OpenLayers 2 getBounds might be your function maps.massgis.state.ma.us/OpenLayers-2.10/doc/devdocs/files/…. OL 3 has openlayers.org/en/v3.12.1/apidoc/ol.extent.html#.boundingExtent.
    – user30184
    Commented Jan 13, 2016 at 15:33

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.