[mapserver-users] MODE=legendicon & GROUP Layers

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Fri Sep 7 09:06:12 PDT 2012


All,

I've gotten around this in the past by using dummy layers specifically for Legend Creation.  You have complete control over the legend this way and can mix and match data sources however is required without needing to actually map the data out.  It is more work overall, but if your MapFiles don't change often, it's usually a one time setup thing.

I have a few map layers that have 7 or 8 different thresholds for display set MIN/MAXSCALEDENOMs and they all get a dummy layer that displays the same thing for all thresholds.

Bobb



From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Andrew Cowie
Sent: Friday, September 07, 2012 10:46 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] MODE=legendicon & GROUP Layers

Hello list

Wondering if anyone can help...

We have been utilising the legendicon mode to create a custom legend in our application, however some recent work to try and speed up our WMS has reworked our mapfiles slightly, making use of GROUP LAYERs to group almost identical LAYERs together, the only difference in the LAYERs being MAX & MINSCALEDENOM and the DATA request string to our PostGIS database - hitting a generalised version of the geometry at smaller scales.

        LAYER
                NAME 'lri_luc_main_gen_500k'
                GROUP 'lri_luc_main'
                DATA 'the_geom_gen_500k FROM "data"."lri" USING UNIQUE gid USING srid=2193'
                INCLUDE 'includes/lri_luc_main_layer.inc'
                MINSCALEDENOM 251001
        END
        LAYER
                NAME 'lri_luc_main_full'
                GROUP 'lri_luc_main'
                DATA 'the_geom FROM "data"."lri" USING UNIQUE gid USING srid=2193'
                INCLUDE 'includes/lri_luc_main_layer.inc'
                MAXSCALEDENOM 251000
                MINSCALEDENOM 15000
        END

The request for the legend icon is of the form:

http://<servername>/cgi-bin/mapserv.fcgi?FORMAT=image/gif&MAP=lri.map&MODE=legendicon&ICON=lri_luc_main,1<http://%3cservername%3e/cgi-bin/mapserv.fcgi?FORMAT=image/gif&MAP=lri.map&MODE=legendicon&ICON=lri_luc_main,1>

This worked fine before we started using GROUPs, however now we now encounter the error:

mapserv(): Web application error. Icon layer=lri_luc_main not found in map file.

Does the legendicon mode work with GROUP layers?
If not, is there a way round this?

Or alternatively, perhaps there is a better way to request a generalised version of the geometry that doesn't involve GROUP LAYERs?

Any help or suggestions much appreciated.

Many thanks

Andrew

________________________________
Please consider the environment before printing this email
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120907/6a84299b/attachment-0001.html>


More information about the mapserver-users mailing list