As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [getlegendgraphic]

GetLegendGraphic is a request operation for an OGC Web Map Service (WMS) that supports optional Styled Layer Descriptor (SLD) operations. The request returns a legend image for a layer (or group of layers) within a WMS.

Filter by
Sorted by
Tagged with
0 votes
0 answers
39 views

GetLegendGraphic in GeoServer won't apply style based on language

Having trouble with i18n in SLD styles in a GetLegendGraphic call, using GeoServer 2.21.4. In the following style the first rule will always get picked up, regardless of any language parameter in the ...
Raine Ekman's user avatar
0 votes
0 answers
21 views

How does getLegendGraphic work with CQL filters?

I have a request I send to get specific layers based on year, type and region. I receive the request for the layers and can display it on the map perfectly. The legend for this layer however, comes ...
u_arcgis's user avatar
1 vote
0 answers
24 views

Horizontal legend in GeoServer but not rotated labels

I am trying to get the legend via GeoServer in horizontal orientation. I use legend_options=layout:horizontal but the labels are still in vertical position. Is there a way to rotate also the labels? ...
Mat's user avatar
  • 11
2 votes
0 answers
31 views

Why does QGIS not show legend when layer has multiple styles

When using QGIS with layers that have one style it loads the legend of that style automatically, which is what I want. But when I have a layer with multiple styles when I load the default layer it ...
botenvouwer's user avatar
1 vote
1 answer
72 views

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

I have a polygon layer published in GeoServer through PostgreSQL (PostGIS) and I am trying to build a legend to use with GetLegendGraphich. The layer is requested as WMS layer in client with Leaflet ...
Andre Silva's user avatar
  • 10.1k
2 votes
1 answer
70 views

How to know if WMS GetLegendGraphic supports bounding box? [closed]

I am working on an application where users can input WMS layers, which is displayed on a map along with the respective legend graphic. Now, I want to display content specific legend graphics based on ...
Lars Eivind's user avatar
0 votes
1 answer
75 views

GeoServer GetLegendGraphic in different Languages using SLD

I am trying generate Legend Graphic in different languages from GeoServer SLD. I came across this GeoServer documentation i18N in SLD Where in the title tag we can specify the localized tag with ...
Arun's user avatar
  • 136
0 votes
1 answer
126 views

Refer to other SLD in geoserver for GetLegendGraphic

I have a group layer in geoserver with all layers having one style each. However, for the legend I want to refer to an "external" SLD (basically a simplified "dummy legend"). The ...
ConcreteJungle's user avatar
0 votes
1 answer
135 views

Changing font type and size in GetLegendGraphic

I've just exported a map but i've realised the font type of what's exactly is being displayed in the legend isn't the same. This is the GetLegendGraphic url referenced in the information tab. https://...
Elliot's user avatar
  • 19
0 votes
0 answers
96 views

GetLegendGraphic with Filtered Range Rules

I have a style with several rules that include range filters. I'm having a hard time getting the appropriate legend graphic for a specific record. For example, a soil depth of 3 should return the ...
Danielle's user avatar
  • 101
0 votes
2 answers
212 views

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

I have a GetLegendGraphic request like: http://localhost:8080/geoserver/ows?service=WMS&request=GetLegendGraphic&width=19&height=19&layer=Workspace:Layer&rule=&bbox=8126200....
Johnny Cash's user avatar
3 votes
1 answer
400 views

Specify legend size in GetLegendGraphic

The WMS call GetLegendGraphic (in my case to Geoserver) returns a single image of icons and legends. How can I specify the width of the returned image? The WIDTH parameter is the width of the ...
Tom Chadwin's user avatar
  • 5,752
1 vote
1 answer
176 views

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

I was able to run my application on using Legend earlier but now I want to update my Legend when scrolling on the map. So I tried to used this code GetLegendGraphic and getLegendUrl function filter by ...
Abhijay Bisht's user avatar
5 votes
1 answer
84 views

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

I need add a legend, banner and signature to my shp file which is exported in PDF. My code: HashMap<String, Object> params = new HashMap<>(); params.put(ShapefileDataStoreFactory....
Re1ease's user avatar
  • 95
0 votes
1 answer
79 views

GetLegendGraphic return a symbol instead of colormap ramp

I'm trying to put inside an OpenLayers project the legend for an NDVI map. Previously I've created with QGIS 3.10 the SLD as indicated on the GeoServer's official documentation. When I try to use ...
MaxDragonheart's user avatar
1 vote
1 answer
2k views

GetLegendGraphic and getLegendUrl function filter by extent

I tried to get a legend image from my GeoServer Instance filtered by extent (render only symbologies that are currently displayed on screen). For this purpose I used the getLegendUrl function from ...
jossefaz's user avatar
  • 187
3 votes
1 answer
149 views

Lizmap legend layer

I'm trying to redirect GetLegendGraphics to another url. I changed LegendUrl in properties layer in QGIS : My Request=GetCapabilities shows the good link to my legend : <Style> <Name>...
SYG's user avatar
  • 180
1 vote
0 answers
425 views

How to modify the automatic GetLegendGraphic in QGIS when using QgsRasterLayer in the python interface to load data from a ncWMS server

tl;dr: How to add an extra parameter (using python) to the GetLegendGraphic request made by QGIS when a WMS layer is added using QgsRasterLayer? UK Reading University developed a map server called ...
Marcelo Andrioni's user avatar
0 votes
1 answer
282 views

Legend Graphic for a multi polygon layer styled the same with unique (different) labels

When creating an SLD for a single polygon layer in QGIS and using that in Geoserver, by default the legend description is "single symbol". When you categorize the single polygon layer symbology and ...
Amelia Nicodemus's user avatar
1 vote
0 answers
371 views

Adding WMS legend to see or remove layers in relation to the layer control? [closed]

This is the code, the problem is that always print the same png legend even if you select another layer. function addLeyenda(layer){ if( layer instanceof L.TileLayer.WMS ){ ...
Héctor SC's user avatar
2 votes
0 answers
365 views

Creating a horizontal legend with labels in GeoServer

Im am trying to ask GeoServer for a horizontally orientated colorbar legend for my raster layer. I prepared an SLD style for the layer and asked for the legend with the GetLegendGraphic method, ...
Jvg's user avatar
  • 143
4 votes
1 answer
513 views

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

I need to send a GetPrint request for a map with a dynamic legend that only shows layers/items/symbols relevant for the current map frame. In QGIS 2.14 one can select "Filter Legend by Map Content" ...
LivaV's user avatar
  • 51
3 votes
0 answers
143 views

Disabling appending of WMS parameters in geting legendurl image?

I used QGIS WMS to connect to our image server but it is displaying an error: Returned legend is flawed Our image sever is using our own image render protocol in legendurl to display image: ...
user135229's user avatar
1 vote
1 answer
638 views

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

Is it possible to set the order of the displayed elements (Layers) in the legend graphic recieved by WMS GetLegendGraphicREQUEST or will MAPSERVER always return in the order of layers defined in the ...
Max's user avatar
  • 83
1 vote
1 answer
467 views

QGIS server legend does not show diagram colors

I have a QGIS version 2.18.18 map with pie-chart diagrams. The pie-chart maps display correctly in both QGIS-desktop and QGIS-server versions. The pie-chart classes are correctly displayed in the QGIS ...
anneb's user avatar
  • 1,281
1 vote
0 answers
74 views

ArcGIS Runtime .NET does not make a GetLegendGraphic request

I'm using ArcGIS runtime SDK .NET to populate maps with WMS Layers This is a bit strange. If I load a WMSLayer on the map without specifying any layer, I see how it starts to recover all the legends ...
imoratieltsyl's user avatar
3 votes
2 answers
2k views

How to get legend image from a WMS using PyQgis

I want to load a WMS with PyQGIS. I know this is possible on version 2.18 If it is done with the graphical Interface by checking on the Use contextual WMS legend Now I manage to load a WMS with ...
George's user avatar
  • 113
1 vote
0 answers
415 views

Mapserver GetLegendGraphic via expression

I am trying around this for a while now. But can't find any answer. So I try it here. What do I have: Mapserver 7.0.6 What do I want: Obtaining a single legend graphic for a class without text and ...
Clemens Rudert's user avatar
6 votes
1 answer
1k views

Dynamic label in SLD Style

I have a dynamic style in Geoserver, like below: <sld:ColorMap> <sld:ColorMapEntry color="#2c7bb6" quantity="${env('low',0)}" label="${env('low',0)}"/> <sld:...
Jose Hermosilla Rodrigo's user avatar
3 votes
0 answers
284 views

LegendGraphic and Label placement

I have to style some Rasters with SLD and get the legend from Geoserver to show it in my webapp. By default, labels are placed right to the Color Ramp. Is there any option, by using SLD or maybe any ...
Jose Hermosilla Rodrigo's user avatar
2 votes
2 answers
188 views

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

I would like to use geoserver to subsample a global raster geotiff into many smaller, regional images. These images all need to have their own legend and descriptive text. In all of the examples that ...
Mike Furlender's user avatar
4 votes
1 answer
4k views

QGIS WMS Layer - Returned legend image is flawed

I succeed in connecting to the following WMS in QGIS (2.14.15 LTR): https://secure.erlangen.de/arcgiser/services/Luftbild2016/MapServer/WMSServer?SERVICE=WMS&REQUEST=GetCapabilities ... with the ...
Jochen Schwarze's user avatar
0 votes
1 answer
566 views

Using YSLD functions and creating legends

My goal is to create legends, for WMS layers, which can be shown in a JavaScript/OpenLayers 3 client. Furthermore I found out, that GeoServer can generate legends via the SLD styles. This legends can ...
gillesB's user avatar
  • 139
2 votes
1 answer
482 views

Geoserver raster legend in reverse order

If you get a legend from a geoserver raster the minimum value will be on top, the maximum at the bottom. <sld:ColorMapEntry color="#FFFFFF" quantity="0" opacity="0" label="0 mm"/> <sld:...
Katharina's user avatar
  • 143
1 vote
1 answer
336 views

How to change getLegendGraphic option default?

I have several geoserver layers that have only one rule. By default, they do not get a text label in the legend. I know if you use LEGEND_OPTIONS=forceLabels:on in the getLegendGraphic call, it will ...
Devin Eyre's user avatar
2 votes
1 answer
37 views

Would like to have a WMS with colored polygon features but not a legend

This is in ArcMap 10.3. I am creating a WMS with a service definition file (I would like to keep the style how my WMS displays the data) - No problem. I have a feature dataset of polygons which I ...
ZZZ's user avatar
  • 520
2 votes
0 answers
340 views

GetLegendGraphic from layergroup in Geoserver 2.8.2

I am working with Geoserver 2.8.2 I am requesting a GetLegendGraphic to a layer group that holds three layers, each layer with one single SLD styling. I am getting a legend from Geoserver, but ...
Antonio Armas Díaz's user avatar
1 vote
1 answer
1k views

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

I have map services published from ArcGIS server being called from Angular- Leaflet app and we are displaying the legend (controlled through map controls) from https://pxxxx.com/arcgis/rest/services/...
Deep's user avatar
  • 779
0 votes
0 answers
697 views

QGIS Server: how to get WMS GetLegendGraphic in HTML?

On MapServer you can get HTML content based legend graphic with WMS GetLegendGraphic. On QGIS we can have only PNGs. It would be nice to have the same behaviour on QGIS Server, with an HTML Template ...
luca76's user avatar
  • 241
1 vote
1 answer
574 views

How to display layer name to GetLegendGraphic request WMS service?

I have a Mapping and WMS Service that I have published via ArcServer 10.3.1. When communicating with the WMS service via a web browser, using a GetLegendGraphic Request. I am returned a graphic of my ...
a1234's user avatar
  • 901
2 votes
0 answers
331 views

How does getLegendGraphic, from GeoServer, handle attribute-based styles?

I have a layer with a color attribute and I write an SLD with a fill color like this: <sld:PolygonSymbolizer> <sld:Fill> <sld:CssParameter name="fill"> <...
joaorodr84's user avatar
2 votes
1 answer
2k views

GetLegendGraphic request string is too long?

I am setting the SLD Body of a WMS layer on the client side. I set the style in JSON and I have some functions that convert the JSON to SLD (OpenLayers functions). It works fine for displaying the ...
joaorodr84's user avatar
3 votes
1 answer
4k views

Geoserver GetLegendGraphic not working for single rule

<?xml version="1.0" encoding="ISO-8859-1"?> <StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www....
boliwe's user avatar
  • 553
6 votes
1 answer
1k views

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

I am using following GetLegendGraphcs request https://develop.blaa.nl/data/test/wms?LAYER=nccw:variabele_woz&request=GetLegendGraphic&format=image/png&styles=nccw_variabele_woz&rule=...
Stefan's user avatar
  • 2,092
1 vote
0 answers
339 views

How to add Legend Panel to Dojo / OpenLayers?

I have OpenLayers app on Dojo framework. I've been serving WMS layers with GeoServer and wanted to use GetLegendGraphic to build legend for all layers. I've seen there are some ready widgets (like ...
Alophind's user avatar
  • 2,687
5 votes
5 answers
11k views

Getting WMS LegendGraphic using GeoServer and GeoWebCache?

I am using GeoServer alongwith the default, build in GeoWebCache. I am using Extjs and GeoExt, as well. Everything is running well, except for the legend graphics request. My code for layers is as ...
thelastray's user avatar
  • 2,824