0

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".
</ServiceException>
</ServiceExceptionReport>

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:

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

Any ideas on why this is happening?

8
  • Please use the edit link to add more information to your question, we need to know what URL parameters you are using
    – Ian Turton
    Jan 16 '20 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
    Jan 16 '20 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
    Jan 16 '20 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
    Jan 16 '20 at 12:05
  • 1
    I think that I answered already in gis.stackexchange.com/questions/347107/…. The question was a bit different, though.
    – user30184
    Jan 22 '20 at 13:12
1

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

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&format=application/vnd.google-earth.kml+XML

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

localhost:8080/geoserver/nyc/wms/kml?layers=nyc:nyc_buildings
4
  • 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
    Jan 17 '20 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
    Jan 17 '20 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
    Jan 21 '20 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
    Jan 21 '20 at 11:36
1

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, privacy policy and cookie policy

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