Is there a way to export into KMl a geoserver layer? I have used KML reflector but this doesnt return the whole content of the layer but a reference to it. Alternatively can I get a KML of a layer using OpenLayers?


1 Answer 1


Reading the documentation a bit more carefully I found out there are different modes. In my case the "download" mode is what I am looking for. From the documentation: "Returns KML which contains the entire data set. In the case of a vector layer, this will include a series of KML placemarks. With raster layers, this will include a single KML ground overlay. This is the only mode that doesn’t dynamically request new data from the server, and thus is self-contained KML."

So my request link looks like:


My problem is that some of the layers are not downloaded correctly and I get a KML file with:

      java.lang.NullPointerException null

while some other work great.

It seems like that the problem I mention was because of the styling of the layer. More specifically, the layers that would have problem to get downloaded as KMLs they had a style, which was assigned to a specific workspace (in geoserver). I have faced this problem in the past and the solution is to leave the choice: workspace (in style of layers) empty.

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.