[Mapbender-users] MB 2.5: Problems with legends in pdf-print using mapserver's agg

Michael Schulz mschulz at webgis.de
Tue Mar 3 08:05:27 EST 2009


Hi Herbert,

I am somewhat at the end of my latin ;-)

class_SaveLegend should create a white background rectangle in each
created legend image. If I remember correctly your using the RGBA mode
in your outputformat. Could you try with only RGB? Maybe the pdf class
image functions cannot handle alpha channel transparency.

Cheers, Michael


2009/3/3 Schönhammer, Herbert <Schoenhammer.Herbert at regensburg.de>:
> Hi Michael,
>
> (sorry today and tomorrow I have a lot of dates :-(, so i'm late to answer ! )
>
> following your hints, I'm observing following:
>
> 1) I'm using again: image/png as wms setting
> 2) $unlink=false: The png -file of the legend-picture is a 24 bit picture with the wrong (=black) background-color
> 3) Looking at apache-log mapbender's getlegendgraphic-request uses "image/png"
> 4) Taking the request from apache-log and sending this request to mapserver: the picture comes with transparent background (like it should be) as a 24 bit png !
>
> => The request from mapbender to mapserver has a correct 24 bit png as result
> => The temporary file in the tmp- directory is also a 24bit png, but with wrong background color
> => This wrong (black) png is inc´luded into the generated pdf !
>
>
> P.S: I'm not able to give you access to the services. From Internet they will be rechable next weak !
>
> regards
> Herbert
>
>
>
>
>
>
>
>>-----Ursprüngliche Nachricht-----
>>Von: mapbender_users-bounces at lists.osgeo.org
>>[mailto:mapbender_users-bounces at lists.osgeo.org] Im Auftrag
>>von Michael Schulz
>>Gesendet: Montag, 2. März 2009 17:57
>>An: Mapbender User List
>>Betreff: Re: [Mapbender-users] MB 2.5: Problems with legends
>>in pdf-print using mapserver's agg
>>
>>
>>Hi,
>>
>>the problem with 24bit rendering is, that mapserver publishes that as
>>"image/png;mode=24bit" in the wms getcapabilities if you don't define
>>a special outputformat. So, when you have set image/png as
>>image-format in mapbender and you get a 24bit png back everything is
>>perfect.
>>
>>Have you tried setting $unlink=false in printPDF.conf and then examine
>>the temporary images while generating the pdf output? I am not sure,
>>if this has impact on the legend images, but it could be worth a try.
>>
>>Cheers, Michael
>>
>>
>>2009/3/2 Schönhammer, Herbert <Schoenhammer.Herbert at regensburg.de>:
>>> Hi Michael,
>>>
>>> sorry I don't really understand your hint :-(
>>>
>>> At the moment I use (wms-gui-settings): "image/png"
>>>
>>> But there is no difference between "image/png" and
>>"image/png; mode=24bit".
>>>
>>> Only the settings in the mapfile determine the outputformat.
>>So the following always generates a 8bit output. In this case,
>>the printig of the picture in the legend is okay, but the
>>quality of the map is very very poor.
>>>
>>> # 8 Bit Farbe
>>> OUTPUTFORMAT
>>>    NAME 'AGG_Q'
>>>    DRIVER AGG/PNG
>>>    IMAGEMODE RGB
>>>    FORMATOPTION "QUANTIZE_FORCE=ON"
>>>    FORMATOPTION "QUANTIZE_DITHER=OFF"
>>>    FORMATOPTION "QUANTIZE_COLORS=256"
>>> END
>>>
>>> So I want a map with 24bit color.
>>>
>>> Please: Could you give me some more hints?
>>>
>>> What shall I use ? "image/png" or "image/png; mode=24bit" in
>>wms-settings?
>>> What settings in the mapfile should be done in this case ?
>>>
>>> regards
>>> Herbert Schönhammer
>>>
>>>
>>>
>>>
>>>>-----Ursprüngliche Nachricht-----
>>>>Von: mapbender_users-bounces at lists.osgeo.org
>>>>[mailto:mapbender_users-bounces at lists.osgeo.org] Im Auftrag
>>>>von Michael Schulz
>>>>Gesendet: Montag, 2. März 2009 14:39
>>>>An: Mapbender User List
>>>>Betreff: Re: [Mapbender-users] MB 2.5: Problems with legends
>>>>in pdf-print using mapserver's agg
>>>>
>>>>
>>>>Hello Mr. Schönhammer,
>>>>
>>>>are you using imagemode "image/png;24bit mode" for this service in
>>>>Mapbender? Then this could be the problem, because printPDF sets the
>>>>imageformat for the maps and the legend icons to image/png.
>>Then maybe
>>>>your customized outputformat isn't used anymore... In the GUI the
>>>>imageformats are used as defined in gui wms settings.
>>>>
>>>>Chees, Michael Schulz
>>>>
>>>>
>>>>
>>>>2009/3/2 Schönhammer, Herbert <Schoenhammer.Herbert at regensburg.de>:
>>>>> Hi list,
>>>>>
>>>>> I have a new strange problem with pdf-print in Mapbender 2.5.
>>>>>
>>>>> Lines should be rendered with rounded linejoins. So I'm
>>>>using mapserver agg
>>>>> - renderer with an outputformat defined like:
>>>>>
>>>>> OUTPUTFORMAT
>>>>>    ##NAME png
>>>>>    ##DRIVER "GD/PNG"
>>>>>    MIMETYPE "image/png"
>>>>>    NAME 'AGGA'
>>>>>    DRIVER AGG/PNG
>>>>>    EXTENSION PNG
>>>>>    IMAGEMODE RGBA
>>>>>    TRANSPARENT ON
>>>>> END
>>>>>
>>>>>
>>>>> Things are done well
>>>>>
>>>>> in the map
>>>>> and in the legend of the gui.
>>>>>
>>>>>
>>>>> Things are going wrong in printing the legend in pdf-print.
>>>>> The legend picture is drawn with a black background. So the
>>>>text of the
>>>>> legend is not readable anymore. (Please see examples in
>>the appendix)
>>>>>
>>>>>
>>>>> Until now I used gd-driver. With gd-driver all things are
>>>>going right.
>>>>>
>>>>> The background of the legend picture is defined transparent.
>>>>So the same
>>>>> legend picture my be used in different guis (with different
>>>>> background-color) and in pdf-Print.
>>>>>
>>>>> LEGEND
>>>>>   STATUS ON
>>>>>   KEYSIZE 298 398
>>>>>   KEYSPACING 10 1
>>>>>   LABEL
>>>>>     TYPE TRUETYPE
>>>>>     FONT "verdana"
>>>>>     SIZE 8
>>>>>     POSITION lc
>>>>>   END # END LABEL
>>>>>   TRANSPARENT ON
>>>>>   IMAGECOLOR 255 255 255
>>>>> END   #LEGEND
>>>>>
>>>>> I'm not able to detect any difference in the pictures
>>>>produced by gd or by
>>>>> agg. In all tools (even photo-editors) the background is displayed
>>>>> transparent. Only in mapbender pdf-print the background is
>>>>displayed in
>>>>> black. So I think, the solution could be in pdf-print ?
>>>>>
>>>>> Has anybody observed similar problems ?
>>>>> Has anybody a tipp ?
>>>>>
>>>>> Thanks a lot
>>>>> Herbert Schönhammer
>>>>>
>>>>> _______________________________________________
>>>>> Mapbender_users mailing list
>>>>> Mapbender_users at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>-----------------------------------------------------------
>>>>Michael Schulz
>>>>mschulz at webgis.de
>>>>
>>>>in medias res
>>>>Gesellschaft für Informationstechnologie mbH
>>>>
>>>>In den Weihermatten 66
>>>>79108 Freiburg
>>>>
>>>>Tel  +49 (0)761 556959-5
>>>>Fax +49 (0)761 556959-6
>>>>
>>>>http://www.webgis.de / http://www.zopecms.de
>>>>-----------------------------------------------------------
>>>>Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
>>>>Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg
>>>>_______________________________________________
>>>>Mapbender_users mailing list
>>>>Mapbender_users at lists.osgeo.org
>>>>http://lists.osgeo.org/mailman/listinfo/mapbender_users
>>>>
>>> _______________________________________________
>>> Mapbender_users mailing list
>>> Mapbender_users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>>>
>>
>>
>>
>>--
>>-----------------------------------------------------------
>>Michael Schulz
>>mschulz at webgis.de
>>
>>in medias res
>>Gesellschaft für Informationstechnologie mbH
>>
>>In den Weihermatten 66
>>79108 Freiburg
>>
>>Tel  +49 (0)761 556959-5
>>Fax +49 (0)761 556959-6
>>
>>http://www.webgis.de / http://www.zopecms.de
>>-----------------------------------------------------------
>>Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
>>Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg
>>_______________________________________________
>>Mapbender_users mailing list
>>Mapbender_users at lists.osgeo.org
>>http://lists.osgeo.org/mailman/listinfo/mapbender_users
>>
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>



-- 
-----------------------------------------------------------
Michael Schulz
mschulz at webgis.de

in medias res
Gesellschaft für Informationstechnologie mbH

In den Weihermatten 66
79108 Freiburg

Tel  +49 (0)761 556959-5
Fax +49 (0)761 556959-6

http://www.webgis.de / http://www.zopecms.de
-----------------------------------------------------------
Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg


More information about the Mapbender_users mailing list