[mapserver-users] FW: problem with legend images

Worth Lutz wal3 at mindspring.com
Wed Nov 20 07:10:01 PST 2013


Thomas,

Thanks for this information. I think the "SCALE=xxx" is what I was looking
for. 

In the second part of your explanation, I understand this to mean that the
legend image is draw at the SYMBOLSCALEDENOM. This would explain what I'm
seeing. I have SYMBOLSCALEDENOM set to a small number. I'll play with this
also.

Worth

-----Original Message-----
From: thomas bonfort [mailto:thomas.bonfort at gmail.com] 
Sent: Wednesday, November 20, 2013 5:16 AM
To: Worth Lutz
Cc: MapserverList OSGEO
Subject: Re: [mapserver-users] FW: problem with legend images

Worth,
this is happening because you are using scale-dependant rendering, but
the legend requests are scale independant. You should be able to
overcome this by adding your wanted scale to a SCALE=xxx url
parameter, or you can rewrite your mapfile by playing with your
layer's SYMBOLSCALEDENOM and setting your style widths to something
more pleasing for your legend output, e.g.

SYMBOLSCALEDENOM 1000
...
WIDTH 10

is equivalent in map outputs to

SYMBOLSCALEDENOM 10000
...
WIDTH 1

whereas the first will produce 10 pixel wide lines in the legend by
defaut vs. 1 pixel wide lines for the second.

regards,
thomas

On 18 November 2013 18:08, Worth Lutz <wal3 at mindspring.com> wrote:
> Hi all,
>
> I am having a problem generating my legend. I have roads which look gook
on
> my map but the legend images generated are not what I expected.
>
> Attached is a picture of a portion of my map and the legend.
>
> Each piece of the legend is retrieved with a "getLegendGraphic" call.
>
> Has any one else run into this problem with "exploded" legends?
>
> Here is one of my classes:
>   CLASS
>     NAME "Interstate Highways"
>     #MAXSCALEDENOM 3000010
>     MINSCALEDENOM 999
>     EXPRESSION "I" # Interstates
>     STYLE
>       COLOR 121 0 255
>       WIDTH 35
>       MINWIDTH 2
>       MAXWIDTH 35
>     END
>     STYLE
>       COLOR 181 51 51
>       WIDTH 33
>       MINWIDTH 0
>       MAXWIDTH 31
>     END
>   END
>
> I get what I was looking for on map but have not figured out how to get
the
> legend to work.
>
> My entire layer definition is show below:
>
> LAYER
>   NAME "NCDOT-roads"
>   GROUP "NCDOT_transportation_group"
>   STATUS off
>   METADATA
>     wms_title           "NCDOT-Roads"
>     wms_srs             "EPSG:2264"
>   END
>   TYPE line
>   UNITS pixels
>   DATA NCDOT/shapefiles/LRS_ARCS
>   PROJECTION
>     "init=epsg:2264" # NAD 83 North Carolina (ftUS)
>   END
>   #MAXSCALEDENOM 3000010
>   MINSCALEDENOM 999
>   SYMBOLSCALEDENOM 1000
>   TEMPLATE void
>   CLASSITEM "rte_1_clss"
>   CLASS
>     NAME "Interstate Highways"
>     #MAXSCALEDENOM 3000010
>     MINSCALEDENOM 999
>     EXPRESSION "I" # Interstates
>     STYLE
>       COLOR 121 0 255
>       WIDTH 35
>       MINWIDTH 2
>       MAXWIDTH 35
>     END
>     STYLE
>       COLOR 181 51 51
>       WIDTH 33
>       MINWIDTH 0
>       MAXWIDTH 31
>     END
>   END
>   CLASS
>     NAME "US Highways"
>     EXPRESSION "US" # US Highways
>     MAXSCALEDENOM 3000010
>     MINSCALEDENOM 999
>     STYLE
>       COLOR 121 121 0
>       WIDTH 35
>       MINWIDTH 2
>       MAXWIDTH 35
>     END
>     STYLE
>       COLOR 181 181 0
>       WIDTH 31
>       MINWIDTH 0
>       MAXWIDTH 31
>     END
>   END
>   CLASS
>     NAME "NC Highways"
>     EXPRESSION "NC" # NC Highways
>     MAXSCALEDENOM 800001
>     MINSCALEDENOM 999
>     STYLE
>       COLOR 181 181 0
>       WIDTH 22
>       MINWIDTH 2
>       MAXWIDTH 22
>     END
>   END
>   CLASS
>     NAME "State Roads"
>     EXPRESSION "SR"   # State Roads
>     MAXSCALEDENOM 70001
>     MINSCALEDENOM 985
>     STYLE
>       COLOR 181 181 0
>       WIDTH 22
>       MINWIDTH 1
>       MAXWIDTH 22
>     END
>   END
>   CLASS
>     NAME "highway ramps"
>     MAXSCALEDENOM 30001
>     EXPRESSION "RMP" # HWY ramps
>     STYLE
>       COLOR 121 121 0
>       WIDTH 30
>       MINWIDTH 1
>       MAXWIDTH 24
>     END
>     STYLE
>       COLOR 181 181 0
>       WIDTH 28
>       MINWIDTH 0
>       MAXWIDTH 20
>     END
>   END
> END # NCDOT-roads
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4158 / Virus Database: 3629/6851 - Release Date: 11/20/13



More information about the mapserver-users mailing list