Tag: MapServer

Custom legend icons in MapServer

Posted by – Thursday 2012-07-05

As seen in a recent post in this blog, MapServer implements the optional WMS request GetLegendGraphic.

You can find that the generated icons do not fit your needs, and prefer that MapServer returns custom legend icons provided by you. Let’s see how can it be accomplished.

First, is convenient that in your LEGEND object you supply the icons size; in our example, it will be 20×20 pixels.

LEGEND
    ...
    KEYSIZE 20 20
END # end of legend object

More…

WMS cascading with MapServer

Posted by – Saturday 2012-06-30

MapServer supports WMS cascading. Recently I have used this feature to serve an ortophoto layer which was already being served from an old WMS service. This feature has allowed me to avoid copying the ortophoto to the new server. Given that orthopotos usually demand lots of hard disk space – even when they are compressed in formats like ECW or MrSID -, I have saved time and storage capacity.

Cascading WMS is easy with MapServer. Just edit the mapfile and add a new layer like the one shown below:

More…

Implementing the WMS GetLegendGraphic request with MapServer

Posted by – Thursday 2012-05-10

UNM’s MapServer supports the WMS request GetLegendGraphic, which according to the WMS specification is not mandatory [note 1].

Fortunately, configuring MapServer to get the WMS server returning the legend graphic for each layer is easy. Unfortunately, the manual section explaining how to do it seems, at least to me, a bit hidden; here is the link: http://bit.ly/Kp3xQx.


notes

[note 1] While UNM’s MapServer – which is free and open source software – as of version 5.2.1, released in January 2009, supported the GetLegendGraphic request, ArcGIS Server – commercial software – did not do it (http://bit.ly/JCcynz) until version 10, released circa October 2011.