1

Currently in Geoserver, when I attached a style to a layer in publishing tab, the preview legend style image under "default style" shows a broken image display.

I also was unable to call it directly via URL getLegendGraphic. It only downloaded an empty WMS file.

The style is working fine when I use Geoserver preview layer.
Anybody had the solution for this problem?

The Geoserver instance version is 2.5.

Edited: Yes, after rechecked, the WMS indeed contains information:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1" >
    <ServiceException code="MissingParameterValue" locator="service">
        Could not determine service
    </ServiceException>
</ServiceExceptionReport>

the url: http://120.10.11.18:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=uptb_gis_bna:lokasi_utama

  • what is in the "empty WMS" file - there should be some XML, please add the contents to your question – Ian Turton Nov 10 '16 at 9:19
  • Also 2.5 is no longer supported - current stable version is 2.10 and maintained version is 2.9 so please upgrade and try again. – Ian Turton Nov 10 '16 at 9:19
  • @iant I have to make use of what is provided since I do not have privilege to upgrade Geoserver currently. – Zuzu Softman Nov 11 '16 at 3:28
0

The error message is quite clear you have not specified the service you require GeoServer to use, or more simply you aren't making a valid request.

A getLegend request should look like:

http://localhost:4080/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=topp%3Astates

There are many further options available that are well documented.

  • I have checked my request following the convention, the request should be valid, but again even in the Geoserver edit layer page -> publishing tab itself, the preview legend that should be appeared only show a broken image link. – Zuzu Softman Nov 11 '16 at 17:08
  • please add the actual URL you are using – Ian Turton Nov 11 '16 at 17:44
  • I update the question to include the URL. – Zuzu Softman Nov 13 '16 at 15:48
  • It does not contain a service element like mine – Ian Turton Nov 13 '16 at 15:50
  • Aah... I see.. the wms. thank you... still i wonder why the geoserver it self shown the broken link and when I inspect the source, also use similar url link as mine.. Anyway, thank you very much for the answer and I will add your answer as the correct answer. – Zuzu Softman Nov 13 '16 at 15:54

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.