I have installed GeoServer 2.16.1 on two independent servers; but both are unable to translate layers to KML (Keyhole Mark-up Language). I receive the following content instead of the KML:

<ServiceExceptionReport version="1.1.1">
    <ServiceException code="InvalidSRS">
        Error occurred decoding the espg code EPSG:2908/kml?layers=nyc:nyc_buildings No code "EPSG:2908/KML?LAYERS=NYC:NYC_BUILDINGS" from authority "European Petroleum Survey Group" found for object of type "IdentifiedObject".

Apparently, the server is trying to interpret "EPSG:2908/KML?LAYERS=NYC:NYC_BUILDINGS" as the EPSG code, instead of just "EPSG:2908".

The URL to generate the KML is:


Any ideas on why this is happening?

  • Please use the edit link to add more information to your question, we need to know what URL parameters you are using
    – Ian Turton
    Commented Jan 16, 2020 at 10:58
  • @IanTurton. Does this help? localhost:8080/geoserver/nyc/wms?service=WMS&version=1.1.0&request=GetMap&layers=nyc%3Anyc_buildings&bbox=983797.5%2C207443.0%2C991899.0625%2C218850.828125&width=545&height=768&srs=EPSG%3A2908/kml?layers=nyc:nyc_buildings
    – Josep
    Commented Jan 16, 2020 at 11:02
  • Please use the edit link to add more information to your question - once it is edited it becomes eligible for reopening
    – Ian Turton
    Commented Jan 16, 2020 at 11:06
  • 2
    The KML output in the layer preview of GeoServer 2.16 is broken. See gis.stackexchange.com/questions/347107/…. However, you are getting the error from your own client, don't you?
    – user30184
    Commented Jan 16, 2020 at 12:05
  • 1
    I think that I answered already in gis.stackexchange.com/questions/347107/…. The question was a bit different, though.
    – user30184
    Commented Jan 22, 2020 at 13:12

2 Answers 2


It's because you are not making a valid WMS request - try something like


or if you want to use the KML reflector which doesn't support changing the SRS.

  • I will try this request next Thursday. I don't have access to the server right now. But, anyway, the request is produced by GeoServer itself; so it must a bug of this particular version.
    – Josep
    Commented Jan 17, 2020 at 15:07
  • I have tried the requests on another GeoServer (same version). But they don't seem to be working. The server returns 'HTTP Status 404 – Not Found'. :(
    – Josep
    Commented Jan 17, 2020 at 15:17
  • Well. It did work on the server. The requests produced some XML, which looks like the desired result. Now I'm trying to sort out how these working URLs are generated, so I don't have to ask for help each time I want to generate one.
    – Josep
    Commented Jan 21, 2020 at 11:30
  • I up-vote your answer, because it helped bring light into the problem. But I believe it was user30184 who truly answered the question. Since I asked "why I can't..."; not "how could I manually fix...".
    – Josep
    Commented Jan 21, 2020 at 11:36

Question already answered here: Unexpected GeoServer behaviour when doing quickstart examples: Error occurred decoding the espg code EPSG:4326/kml?layers=topp:states

There is a bug in this particular version of GeoServer (2.16.1).

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.