Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking the way to exporting an especific region of a WMS layer to some XML format (GeoJSON, GML, KML) using OpenLayers and Geoserver. I've found how to export features objects with OpenLayers.Format.GeoJSON.write(), but this method only allow converting feature objects or geometry objects.

An example of my idea: I'm viewing a map of a certain country with a couple of WMS layers with some data. Then I zoom to a particular state of that country and I want to export what I'm viewing to GeoJSON or KML for use that in a desktop GIS application (like QGIS).

Does anyone know how to do this?


share|improve this question

You can do the following:

  • Get the bounding box of the area that you are requesting


  • Build a WFS request using the BBOX here a simple request. As output format choose json

share|improve this answer

In this thread there is an interesting answer about getting a KML representation with WMS. The only problem that I've found is that Qgis has problems with a KML with multiple geometries.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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