Discussion:
Wrong/different legend generation
Dejan Gambin
2014-02-20 08:20:04 UTC
Permalink
Hi,

I am using GetLegendGraphic request for generating legends in my OL application. Everything was fine in previous MapServer version 6.0.3. The request like this:

http://my.site.com/cgi-bin/mywms6?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=my_layer

returned an image like in attached image1.png. The same request in 6.4.1 returned an image like in attached image2.png. The legend part of mapfile is:

LEGEND
OUTLINECOLOR 194 194 194
KEYSIZE 25 18
KEYSPACING 8 5
LABEL
COLOR 255 0 0
FONT Arial
SIZE 8
TYPE truetype
OFFSET 0 -5
END
END

Is it a bug or should I hopefully just configure things differently?

Thanks very much

regards, dejan
Dejan Gambin
2014-03-28 22:10:03 UTC
Permalink
Does anyone have a clue about this? Not sure if this is a bug or not :-(

thx, dejan

Begin forwarded message:

> From: Dejan Gambin <***@coin.hr>
> Date: 20. veljaèe 2014. 09:20:04 GMT+0100
> To: mapserver-***@lists.osgeo.org
> Subject: [mapserver-users] Wrong/different legend generation
>
> Hi,
>
> I am using GetLegendGraphic request for generating legends in my OL application. Everything was fine in previous MapServer version 6.0.3. The request like this:
>
> http://my.site.com/cgi-bin/mywms6?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=my_layer
>
> returned an image like in attached image1.png. The same request in 6.4.1 returned an image like in attached image2.png. The legend part of mapfile is:
>
> LEGEND
> OUTLINECOLOR 194 194 194
> KEYSIZE 25 18
> KEYSPACING 8 5
> LABEL
> COLOR 255 0 0
> FONT Arial
> SIZE 8
> TYPE truetype
> OFFSET 0 -5
> END
> END
>
> Is it a bug or should I hopefully just configure things differently?
>
> Thanks very much
>
> regards, dejan
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-***@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
Lime, Steve D (MNIT)
2014-03-30 17:06:16 UTC
Permalink
Certainly looks like a bug but it would help to see the layer defs for one of the solid fills layers and one of the line layers. Are you setting map resolution explicitly? --Steve

________________________________
From: mapserver-users-***@lists.osgeo.org [mapserver-users-***@lists.osgeo.org] on behalf of Dejan Gambin [***@coin.hr]
Sent: Friday, March 28, 2014 5:10 PM
To: mapserver-***@lists.osgeo.org
Subject: [mapserver-users] Fwd: Wrong/different legend generation

Does anyone have a clue about this? Not sure if this is a bug or not :-(

thx, dejan

Begin forwarded message:

From: Dejan Gambin <***@coin.hr<mailto:***@coin.hr>>
Date: 20. veljaèe 2014. 09:20:04 GMT+0100
To: mapserver-***@lists.osgeo.org<mailto:mapserver-***@lists.osgeo.org>
Subject: [mapserver-users] Wrong/different legend generation

Hi,

I am using GetLegendGraphic request for generating legends in my OL application. Everything was fine in previous MapServer version 6.0.3. The request like this:

http://my.site.com/cgi-bin/mywms6?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=my_layer

returned an image like in attached image1.png. The same request in 6.4.1 returned an image like in attached image2.png. The legend part of mapfile is:

LEGEND
OUTLINECOLOR 194 194 194
KEYSIZE 25 18
KEYSPACING 8 5
LABEL
COLOR 255 0 0
FONT Arial
SIZE 8
TYPE truetype
OFFSET 0 -5
END
END

Is it a bug or should I hopefully just configure things differently?

Thanks very much

regards, dejan

[cid:F50C06C6-BDC8-41AF-B14A-920BD6E6107C][cid:4473B56C-8103-4E44-B722-56A35558536F]
Dejan Gambin
2014-03-31 09:11:45 UTC
Permalink
Here it is:

Solid layer example:

CLASS
Name 'Golf, sport and recreation'
EXPRESSION ('[namjena_oz]' eq 'R' OR '[namjena_oz]' eq 'R1' OR '[namjena_oz]' eq 'R2' OR '[namjena_oz]' eq 'Rt' OR '[namjena_oz]' eq 'PN+R' OR '[namjena_oz]' eq 'R2/R6')
COLOR 0 255 0
OUTLINECOLOR 0 0 0
END


Line layer example

CLASS
Name 'City'
STYLE
COLOR 250 0 0
WIDTH 3
END
END


But this all doesn't seem to be the problem as it happens on all possible layers. Decreasing font size helps in a way the legend text is smaller but it still "doesn't fit". Take a look on attached picture (font size 6 and 8, text is cut)

I have resolution explicitly set to 96.




On 30. oŸu. 2014., at 19:06, Lime, Steve D (MNIT) wrote:

> Certainly looks like a bug but it would help to see the layer defs for one of the solid fills layers and one of the line layers. Are you setting map resolution explicitly? --Steve
>
> From: mapserver-users-***@lists.osgeo.org [mapserver-users-***@lists.osgeo.org] on behalf of Dejan Gambin [***@coin.hr]
> Sent: Friday, March 28, 2014 5:10 PM
> To: mapserver-***@lists.osgeo.org
> Subject: [mapserver-users] Fwd: Wrong/different legend generation
>
Dejan Gambin
2014-04-04 11:07:41 UTC
Permalink
I believe I didn't send the answer to the list. So, yes it works in this case. Is it then a bug and should I report it?

On 31. oŸu. 2014., at 23:53, Lime, Steve D (MNIT) wrote:

> What happens if you comment out the resolution value and use the default?
>
> From: mapserver-users-***@lists.osgeo.org [mailto:mapserver-users-***@lists.osgeo.org] On Behalf Of Dejan Gambin
> Sent: Monday, March 31, 2014 4:12 AM
> To: mapserver-***@lists.osgeo.org
> Subject: Re: [mapserver-users] Fwd: Wrong/different legend generation
>
> Here it is:
>
> Solid layer example:
>
> CLASS
> Name 'Golf, sport and recreation'
> EXPRESSION ('[namjena_oz]' eq 'R' OR '[namjena_oz]' eq 'R1' OR '[namjena_oz]' eq 'R2' OR '[namjena_oz]' eq 'Rt' OR '[namjena_oz]' eq 'PN+R' OR '[namjena_oz]' eq 'R2/R6')
> COLOR 0 255 0
> OUTLINECOLOR 0 0 0
> END
>
>
> Line layer example
>
> CLASS
> Name 'City'
> STYLE
> COLOR 250 0 0
> WIDTH 3
> END
> END
>
>
> But this all doesn't seem to be the problem as it happens on all possible layers. Decreasing font size helps in a way the legend text is smaller but it still "doesn't fit". Take a look on attached picture (font size 6 and 8, text is cut)
>
> I have resolution explicitly set to 96.
>
>
> <image001.png>
>
> On 30. oŸu. 2014., at 19:06, Lime, Steve D (MNIT) wrote:
>
>
> Certainly looks like a bug but it would help to see the layer defs for one of the solid fills layers and one of the line layers. Are you setting map resolution explicitly? --Steve
>
> From: mapserver-users-***@lists.osgeo.org [mapserver-users-***@lists.osgeo.org] on behalf of Dejan Gambin [***@coin.hr]
> Sent: Friday, March 28, 2014 5:10 PM
> To: mapserver-***@lists.osgeo.org
> Subject: [mapserver-users] Fwd: Wrong/different legend generation
>
>
gisworks
2014-05-02 07:28:11 UTC
Permalink
Same problem here.
With FONT Type bitmap the legend Image is correctly sized.
Maybe some bug with calculating the font metrics of true type fonts.



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Wrong-different-legend-generation-tp5104852p5138234.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
Loading...