[Mapserver-users] Legend templates, classes and lines...

Steve Lime steve.lime at dnr.state.mn.us
Thu Jun 26 14:41:57 PDT 2003


The function msCreateLegendIcon already calls msClearLayerPenValues()
just before creating the legend image so it looks like that's not the
problem.

Steve

>>> Daniel Morissette <morissette at dmsolutions.ca> 06/26/03 09:26AM >>>
Steve,

Something that changed between 3.6 and 4.0 is color handling.  Could
it
be that we need a call to msClearPenValues() in msCreateLegendIcon()?

Daniel



Steve Lime wrote:
> 
> It's looking like a memory issue. The same legend works perfectly in
> 3.6. *argh*
> 
> Steve
> 
> >>> <Jean-Francois.Doyon at CCRS.NRCan.gc.ca> 06/24/03 03:43PM >>>
> Steve,
> 
> Hmmm, well the loop counter is definitely a possibility, though you
> will
> notice that there is a class index value used in the generation of
the
> filename for the class symbol, and it DOES increase ... (Just look
at
> the
> filenames, you'll see a _0_ , _1_ , _2_ and so on for symbols of
> different
> classes within one layer).
> 
> You know what I think I just noticed? All of our maps that use lines
> use
> different line styles and color for each class (At least so far as I
> can
> tell) ... this would explain why we never notied this.
> 
> A couple of things to look at: Does it happen with the GIF legend?
If
> not, I
> would suggest you try different line styles within that same layer
for
> each
> class, see if suddenly the colors come out right ... That'll at
least
> give
> you a good indication of where to look for the problem (which will
be
> in the
> code!).
> 
> I suppose that could yet be with some other counter ... I would be
> more
> inclined to suspect a pointer problem in this case.
> 
> J.F.
> 
> -----Original Message-----
> From: Steve Lime [mailto:steve.lime at dnr.state.mn.us] 
> Sent: Tuesday, June 24, 2003 4:15 PM
> To: Jean-Francois.Doyon at ccrs.nrcan.gc.ca;
> mapserver-users at lists.gis.umn.edu 
> Subject: RE: [Mapserver-users] Legend templates, classes and
lines...
> 
> J.F. - I verified that the 3 files are indeed the same. I'll paste
the
> layer definition below but it's pretty straight forward. Only thing
I
> can think of is a stuck loop counter someplace. I'll try using a
STYLE
> instead of just a COLOR and see if that helps.
> 
> Steve
> 
>   #
>   # Railroad Rights-of-Way Prairies
>   #
>   LAYER
>     NAME mnrrpln3
>     METADATA
>       "TITLE" "Railroad Rights-of-Way Prairies"
>     END
>     MAXSCALE 500000
>     SYMBOLSCALE 200000
>     STATUS OFF
>     DATA shapefiles/heritage/mnrrpln3
>     TYPE line
>     CLASSITEM 'quality'
>     CLASS
>       NAME 'Very Good'
>       EXPRESSION 'Very Good'
>       SYMBOL 'circle'
>       COLOR 255 0 0
>       SIZE 2
>       MAXSIZE 3
>       MINSIZE 1
>     END
>     CLASS
>       NAME 'Good'
>       EXPRESSION 'Good'
>       SYMBOL 'circle'
>       COLOR 255 125 33
>       SIZE 2
>       MAXSIZE 3
>       MINSIZE 1
>     END
>     CLASS
>       NAME 'Fair'
>       EXPRESSION 'Fair'
>       SYMBOL 'circle'
>       COLOR 255 211 23
>       SIZE 2
>       MAXSIZE 3
>       MINSIZE 1
>     END
>   END # mnrrpln3
> 
> >>> <Jean-Francois.Doyon at CCRS.NRCan.gc.ca> 06/24/03 01:02PM >>>
> Steve,
> 
> Hmmm, as you know we use HTML legends extensively, and as of yet
I've
> never
> heard of anybody running into this kind of problem in our shop.
> 
> It's a pretty simple legend template too, not much room for error.
> 
> Also the page output suggests MapServer DID indeed render 3
different
> icons
> for each of the classes.
> 
> I would try looking at the caching features of MapServer ... Maybe
> it's
> not
> overwriting previous icons? Clear the temp directory or something
like
> that?
> 
> Maybe you could send the mapfile along to see if there's anything
> weird
> in
> there? Otherwise, I'm afraid you'll have to look in the code!
> 
> Good luck!
> 
> J.F.
> 
> -----Original Message-----
> From: Steve Lime [mailto:steve.lime at dnr.state.mn.us] 
> Sent: Tuesday, June 24, 2003 1:48 PM
> To: mapserver-users at lists.gis.umn.edu 
> Subject: [Mapserver-users] Legend templates, classes and lines...
> 
> Hi Folks: I'm using 4.0 and wondered if anyone else has run into
> problems with legend templates with LINE layers and multiple
classes.
> Check out the following URL:
> 
> 
>
http://maps.dnr.state.mn.us/cgi-bin/mapserv40?mapserv=http%3A//maps.dnr.stat

> 
>
e.mn.us/cgi-bin/mapserv40&map_status=on&mapsize=800+750&map=LANDVIEW_HERITAG
>
E_MAPFILE&template=/usr/local/www/docs/landview/heritage/templates/print.htm
>
l&mapext=316287.17433148284+4891207.862044461+342298.221100423+4910705.97065
> 5294&layers=mnrrpln3+mnnpcpy3+mnsbspy3+lakes+ctybdln2+doq03im4
> 
> It's a "print" layout and uses the legend template functionality.
The
> problem is that the line legend for the "Railroad Rights-of-Way
> Praries"
> ain't right. The 3 classes should be red, yellow and orange (as in
the
> map) and not all red. The polygon layer below it ("Sites of
> Biodiversity
> Significance") works as expected. Before I run to the source code I
> want
> to make sure I'm not doing anything stupid. The legend template is
> included below.
> 
> Steve



More information about the MapServer-users mailing list