pre-release version 0.9 (September, 2001)
© Pedro Pereira Gonçalves (pedro@inovagis.org)

Original File legendparam.htm
Abstract This web page sumarizes the GIServer parameters created to enhace the interactivity with the Web Map Server for displaying legend information of geographical data.
Author Pedro Pereira Gonçalves (email)
Last Change
History 2002-02-21 : File Created
Index Page GIServer tutorial
Important Links:


The GIServer enabled the automatic creation of legends when requesting geographic layers. All the legend specific parameters should be added to the layers own name
    <dataset>.<layer>.LEGEND.<specfic parameter> = <value>
The legend also work as a service, so to request only the legend without the data just set the LAYERS=Legend(<dataset>.<layer>).

The FORMAT returned from a LEGEND request can be defined in any of this parameters:
  • <dataset>.<layer>.LEGEND.FORMAT parameter
  • <dataset>.<layer>.FORMAT parameter
  • FORMAT parameter
Where the first found will defined the format returned.

Note : In this version the GIServer only retrieves legends from GIServer's registered data and does not fetchs legend from other WMS's.
Even if the GIServer parameters do NOT respect the WMS specification, all these non-WMS conformant parameters might be transformed in to style definition (see Styles and GIServer Parameters)

For legend creation the following parameters are defined:
  • .LEGEND
    To automatically add a legend to your request it is only necessary to assign any of the legend parameters or <dataset>.<layer>.LEGEND=TRUE to it. Please note that the server places by default the legend at the top right position of the returned image.

    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND=TRUE



  • .X
    Sets the X-axis position where to draw the legend. It is expressed in pixels with 0 starting from the left. If the value is negative it represents the space between the legend and the right part of the image.

    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5


  • .Y
    Sets the Y-axis position where to draw the legend. It is expressed in pixels with 0 starting from the top. If the value is negative it represents the space between the legend and the bottom part of the image.

    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20


  • .HORIZONTAL
    This parameter informs the server to draw the legend in the horizontal.


    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.HORIZONTAL=TRUE


  • .TEXT
    The TEXT parameter displays its value to the legend. If the parameter value is equal to TRUE then the text displayed will be the title of the dataset as defined the the GIServer Manager.


    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.HORIZONTAL=TRUE &
    PORTUGAL.ALT_2500.LEGEND.TEXT=TRUE


  • .WIDTH
    By default the server will choose a given width dependent of the type of legend to be drawn. Settting this parameter the server will disregard the logical size and proportions of the legend and will force the legend to the width specified .


    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.HORIZONTAL=TRUE &
    PORTUGAL.ALT_2500.LEGEND.WIDTH=100


  • .MAXWIDTH
    By default the server will choose a given width dependent of the type of legend to be drawn. Settting this parameter the server will limit the calculated width to this value maintaining the legend width/height ratio.


    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.HORIZONTAL=TRUE &
    PORTUGAL.ALT_2500.LEGEND.MAXWIDTH=150


  • .HEIGHT
    By default the server will choose a given height dependent of the type of legend to be drawn. Settting this parameter the server will disregard the logical size and proportions of the legend and will force the legend to the height specified .


    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.WIDTH=50 &
    PORTUGAL.ALT_2500.LEGEND.HEIGHT=100


  • .MAXHEIGHT
    By default the server will choose a given height dependent of the type of legend to be drawn. Settting this parameter the server will limit the calculated height to this value maintaining the legend width/height ratio.



    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.MAXHEIGHT=100 &



  • .COLOR
    Determines the color of the legend background. If this value is white (0xFFFFFF) then the legend is transparent.


    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.WIDTH=50 &
    PORTUGAL.ALT_2500.LEGEND.HEIGHT=100 &
    PORTUGAL.ALT_2500.LEGEND.COLOR=0xC0C0C0


  • .PENCOLOR
    Determines the color of the legend border.


    REQUEST=GETMAP&
    LAYERS=PORTUGAL.ALT_2500, TERRA.BORDERS&
    SRS=EPSG:4326&
    WIDTH=300&
    HEIGHT=300&
    FORMAT=GIF&
    BBOX=-11,35,5,43&
    PORTUGAL.ALT_2500.LEGEND.X=-5 &
    PORTUGAL.ALT_2500.LEGEND.Y=-20&
    PORTUGAL.ALT_2500.LEGEND.WIDTH=50 &
    PORTUGAL.ALT_2500.LEGEND.HEIGHT=100 &
    PORTUGAL.ALT_2500.LEGEND.COLOR=0xC0C0C0 &
    PORTUGAL.ALT_2500.LEGEND.PENCOLOR=0x101010


See also:

This is a old historical version of the inovaGIS site For updated info about GIServer please go to http://giserver.terradue.com/