Skip to main content
6 votes
Accepted

GetLegendGraphic and getLegendUrl function filter by extent

As specified in the docs of GeoServer : https://docs.geoserver.org/stable/en/user/services/wms/get_legend_graphic/index.html#content-dependent-legends Content dependent evaluation is enabled via ...
jossefaz's user avatar
  • 237
5 votes
Accepted

How to know if WMS GetLegendGraphic supports bounding box?

GetLegendGraphic is defined in the SLD standard https://www.ogc.org/standard/sld/. Support for SLD is optional in WMS. I think that you have done almost everything that you can. WMS is based on the ...
user30184's user avatar
  • 65.6k
5 votes
Accepted

Specify legend size in GetLegendGraphic

As far as I know, the overall size of the legend cannot be forced, and there is no word-wrapping logic (only the labelling engine in the map supports word wrapping, the legend graphic builder is an ...
Andrea Aime's user avatar
  • 17.4k
5 votes
Accepted

QGIS WMS Layer - Returned legend image is flawed

This is more of an extended comment than a complete answer. I note you have to tell QGIS to ignore the GetMap / GetFeatureInfo URIs advertised in the GetCapabilities response. The service is HTTPS, ...
nmtoken's user avatar
  • 13.4k
5 votes
Accepted

Dynamic label in SLD Style

The documentation does not include "label" as an attribute that can take expressions, it states "Most of the ColorMapEntry attributes (color, quantity and opacity) can be defined using cql expressions"...
Andrea Aime's user avatar
  • 17.4k
4 votes

Geoserver raster legend in reverse order

If memory serves me well, the SLD specification mandates that the colormap is to be provided in increasing values order. I'm not aware of options in GeoServer to change that. So I don't believe you ...
Andrea Aime's user avatar
  • 17.4k
4 votes
Accepted

Lizmap legend layer

Yes, lizmap does not use legendURL. This feature has not been requested. Can you open a feature request ? https://github.com/3liz/lizmap-web-client/issues
rldhont's user avatar
  • 56
3 votes

How to get legend image from a WMS using PyQgis

When you use QGIS to Add a WMS Layer through the GUI, when you have selected the service URL and click connect, in the background QGIS runs a WMS GetCapabilities request. If you don't click the Use ...
nmtoken's user avatar
  • 13.4k
3 votes

Is it possible to have a legend and other 'decorations' above the raster image in geoserver?

Seems like a job for the print plugin (normally used to generate PDFs, but it can build PNGs for you as well): http://docs.geoserver.org/latest/en/user/extensions/printing/index.html
Andrea Aime's user avatar
  • 17.4k
2 votes

Is it possible to have a legend and other 'decorations' above the raster image in geoserver?

TLDR; No You can either have GeoServer draw on top of the map using the decorators provided. Or you can use a client of your choosing to deal with drawing a map exactly as you would like. I expect a ...
Ian Turton's user avatar
  • 81.6k
2 votes

Using YSLD functions and creating legends

I took a look into into the generated SLD and saw that it also uses the Categorize() function. Therefore I tried to rewrite the YSLD without using Categorize(). With that YSLD the legend was created ...
gillesB's user avatar
  • 149
2 votes

How to call Legend end points of multiple layers published from Geoserver?

According to this blog, the GetLegendGraphic call will render a legend for Layer Groups. However, I wasn't able to confirm that in Geoserver documentation--perhaps because it's implicit that it should ...
elrobis's user avatar
  • 6,456
2 votes

Map not loading when using getLegend and showing error for getView()

Instead of using new ol.layer.Tile({ source : new ol.source.TileWMS({ url: 'http://localhost:8089/geoserver/India/wms', params: {'LAYERS': 'India:India', 'TILED': ...
Mike's user avatar
  • 12.5k
2 votes
Accepted

How to add a legend, banner to shp file exported in PDF

One of the joys of open source software is the easy you can "borrow" code from another project. GeoServer is built using GeoTools and can produce a legend graphic from a list of layers and ...
Ian Turton's user avatar
  • 81.6k
2 votes

How can I add multiple rules in a GetLegendGraphic request in Geoserver?

You need to use RULES instead of RULE in your url to pass multiple rules https://develop.blaa.nl/data/test/wms?LAYER=nccw:variabele_woz&request=GetLegendGraphic&format=image/png&styles=...
prem30488's user avatar
  • 371
2 votes

How to get legend image from a WMS using PyQgis

You need to set the contextualWMSLegend=1 and don't forget to set the style property in the URL of the layer. For example: quri = QgsDataSourceURI() quri.setParam("layers", ’usa:states’) ...
Sebastian Salazar's user avatar
2 votes

GeoServer GetLegendGraphic for multiple layers

The default GeoServer data directory comes with a couple of configured layer groups. I had a test with the "spearfish" group. http://localhost:8080/geoserver/wms?service=WMS&version=1.1....
user30184's user avatar
  • 65.6k
1 vote
Accepted

How to build a legend for polygon layer with fill color coming from data field?

You can prepare a style with sections that are meant just legend production, and section just for rendering (or for both). See here: https://docs.geoserver.org/stable/en/user/styling/sld/extensions/...
Andrea Aime's user avatar
  • 17.4k
1 vote

GeoServer GetLegendGraphic in different Languages using SLD

It's happening because you are using SLD 1.1, Style internationalization is supported in SLD 1.0 only. As a rule of thumb, try not to use SLD 1.1 in GeoServer, while compatible, it supports a subset ...
Andrea Aime's user avatar
  • 17.4k
1 vote
Accepted

Refer to other SLD in geoserver for GetLegendGraphic

If your style is already published by GeoServer then you can just use the style parameter in the GetLegend request: http://localhost:8080/geoserver/ows?service=WMS&request=GetLegendGraphic&...
Ian Turton's user avatar
  • 81.6k
1 vote
Accepted

The GetLegendGraphic query does not return legends for the specified bbox value

It's just need turn off "Support on the fly geometry simplification".
Johnny Cash's user avatar
1 vote

The GetLegendGraphic query does not return legends for the specified bbox value

A contextual GetLegendGraphic request doesn't give you a legend in a bounding box, it gives a legend for a bounding box (of a specific GetMap request). A standard GetLegendGraphic request gives you a ...
nmtoken's user avatar
  • 13.4k
1 vote
Accepted

Is it possible to get a dynamic legend in QGIS 3.6?

Getlegendgraphic was ignoring the BBOX-parameter for layers inherited from QGIS2. I probably need to add them all over again
LivaV's user avatar
  • 51
1 vote
Accepted

How to set the order of layers in mapservers legend graphic?

GetLegendGraphic has a mandatory parameter LAYER which accepts only one layer as a value mapserver.org/ogc/wms_server.html?. So you cannot order the layers because there will always be just one. Sort ...
user30184's user avatar
  • 65.6k
1 vote

QGIS server legend does not show diagram colors

problem (almost) solved in QGIS version 3.0.1 The layers panel in QGIS-desktop 3.0.1: The getlegendgraphic from the QGIS-server 3.0.1: For some reason the layer names are now duplicated. The ...
anneb's user avatar
  • 1,371
1 vote

How to change getLegendGraphic option default?

No, to the extent of my knowledge there is none, besides changing the code, as of GeoServer 2.10.x (current stable). If you are interested in getting that functionality see a guide here: https://...
Andrea Aime's user avatar
  • 17.4k
1 vote

How to display layer name to GetLegendGraphic request WMS service?

One way of doing this is to create your own legend graphic image using software of your choice and saving this to your web server. Then you need to create a custom (external) GetCapabilities response ...
nmtoken's user avatar
  • 13.4k

Only top scored, non community-wiki answers of a minimum length are eligible