[mapserver-users] AGG_Q + raster problem

Brent Fraser bfraser at geoanalytic.com
Wed Feb 20 19:04:32 EST 2008


How are you asking mapserver to generate the png file?  Are you issuing a
URL in a browser then doing a "save as"? Or from a WMS client?  Have you
tried using shp2img on the command line instead of mapserv.exe?

> Hi, Brent
>
> First of all, thank you for your time.
>
> The test resulted unsuccessful; with GD the result is the same, as you can
> see in the attachment...
>
>
> Thanks.
>
> -----Mensaje original-----
> De: Brent Fraser [mailto:bfraser at geoanalytic.com]
> Enviado el: miércoles, 20 de febrero de 2008 16:07
> Para: Hans Castorp
> CC: mapserver-users at lists.osgeo.org
> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>
> Well, at least we know it's an output problem, not an input
> or processing directive problem.  We could test to see if
> the problem is with the AGG renderer by using the old GD
> renderer:
>
>   IMAGETYPE GD_RGB_PNG    # output type
>   OUTPUTFORMAT
>     NAME 'GD_RGB_PNG'
>     DRIVER GD/PNG
>     IMAGEMODE RGBA
> #    IMAGEMODE RGB
>   END
>
> Brent Fraser
> GeoAnalytic Inc.
> Calgary, Alberta
>
>
> ----- Original Message -----
> From: "Hans Castorp" <hanscastorp76 at yahoo.es>
> To: "'Brent Fraser'" <bfraser at geoanalytic.com>
> Cc: <mapserver-users at lists.osgeo.org>
> Sent: Wednesday, February 20, 2008 2:33 AM
> Subject: RE: [mapserver-users] AGG_Q + raster problem
>
>
> Hi, Brent
>
> Setting the output format to jpeg the rendering is perfect,
> as you can see
> in the attached tile. But this doesn't help me; I need a
> format with
> transparency...
>
>
> Thanks,
>
>
> -----Mensaje original-----
> De: Brent Fraser [mailto:bfraser at geoanalytic.com]
> Enviado el: martes, 19 de febrero de 2008 19:34
> Para: Hans Castorp
> CC: mapserver-users at lists.osgeo.org
> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>
> I'm running out of ideas.  Have you tried setting the output
> format to JPG?  Since it's a 24-bit format (only), this
> might indicate if the problem is in the output stage or in
> the input/processing stage.
>
> Brent Fraser
> GeoAnalytic Inc.
> Calgary, Alberta
> ----- Original Message -----
> From: "Hans Castorp" <hanscastorp76 at yahoo.es>
> To: "'Brent Fraser'" <bfraser at geoanalytic.com>
> Cc: <mapserver-users at lists.osgeo.org>
> Sent: Tuesday, February 19, 2008 11:28 AM
> Subject: RE: [mapserver-users] AGG_Q + raster problem
>
>
> Yes, I'm completely sure that the image I've attached was
> produced with this
> OUTPUT statement:
>
>   OUTPUTFORMAT
>     NAME 'AGGA'
>     DRIVER AGG/PNG
>     IMAGEMODE RGBA
>     FORMATOPTION "TRANSPARENT=ON"
>     #TRANSPARENT ON
>   END
>
>
>
> -----Mensaje original-----
> De: Brent Fraser [mailto:bfraser at geoanalytic.com]
> Enviado el: martes, 19 de febrero de 2008 18:38
> Para: Hans Castorp
> CC: mapserver-users at lists.osgeo.org
> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>
> Hans,
>
>   I did a "gdalinfo" on the image you attached, it has only
> 32 colors defined (so it looks "bad"):
>
> Driver: PNG/Portable Network Graphics
> Size is 256, 256
> Coordinate System is `'
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0,  256.0)
> Upper Right (  256.0,    0.0)
> Lower Right (  256.0,  256.0)
> Center      (  128.0,  128.0)
> Band 1 Block=256x1 Type=Byte, ColorInterp=Palette
>   NoData Value=0
>   Color Table (RGB with 32 entries)
>     0: 239,235,231,0
>     1: 126,63,0,255
>     2: 189,189,63,255
>     3: 126,126,189,255
>     4: 63,126,126,255
>     5: 189,252,189,255
>     6: 63,0,63,255
>     7: 0,63,63,255
>     8: 63,63,126,255
>     9: 252,189,252,255
>    10: 126,63,126,255
>    11: 189,252,126,255
>    12: 189,126,189,255
>    13: 63,0,0,255
>    14: 189,126,63,255
>    15: 126,189,63,255
>    16: 0,63,0,255
>    17: 252,189,126,255
>    18: 252,189,189,255
>    19: 126,189,126,255
>    20: 252,252,189,255
>    21: 189,126,126,255
>    22: 0,0,0,255
>    23: 63,126,63,255
>    24: 189,189,189,255
>    25: 252,252,252,255
>    26: 63,63,0,255
>    27: 189,189,126,255
>    28: 126,63,63,255
>    29: 126,126,126,255
>    30: 63,63,63,255
>    31: 126,126,63,255
>
> Are you sure this is the image produced from your new map
> file (it's not an old one left over from an earlier attempt
> is it)?
>
> Brent Fraser
> GeoAnalytic Inc.
> Calgary, Alberta
>
> ----- Original Message -----
> From: "Hans Castorp" <hanscastorp76 at yahoo.es>
> To: "'Brent Fraser'" <bfraser at geoanalytic.com>
> Cc: <mapserver-users at lists.osgeo.org>
> Sent: Tuesday, February 19, 2008 10:25 AM
> Subject: RE: [mapserver-users] AGG_Q + raster problem
>
>
> Removing DITHER statement I get an "8 bit like" image, as
> you can see in the
> attachment...
> I think I'm going crazy with all this trouble...
>
>
> -----Mensaje original-----
> De: Brent Fraser [mailto:bfraser at geoanalytic.com]
> Enviado el: martes, 19 de febrero de 2008 18:07
> Para: Hans Castorp
> CC: mapserver-users at lists.osgeo.org
> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>
> Hans,
>
>   Try removing  PROCESSING "DITHER=YES" from the ORTOFOTO
> layer definition.  I think it is converting the 24-bit input
> raster to 8-bit before it renders it to the 24-bit output
> image.
>
> Brent Fraser
> GeoAnalytic Inc.
> Calgary, Alberta
>
> ----- Original Message -----
> From: "Hans Castorp" <hanscastorp76 at yahoo.es>
> To: "'Brent Fraser'" <bfraser at geoanalytic.com>
> Cc: <mapserver-users at lists.osgeo.org>
> Sent: Tuesday, February 19, 2008 9:36 AM
> Subject: RE: [mapserver-users] AGG_Q + raster problem
>
>
> Hi, Brent
>
> I'm using mapserver 5.0.0 for Windows.
>
> I have no problems with vectorial data (shapefiles). The
> rest of my mapfile
> is like this:
>
> MAP
>   NAME 'gmap'
>   SIZE 800 600
>   STATUS ON
>   EXTENT 559273 4709373 584263 4737543
>   FONTSET cartografia.fonts
>   TRANSPARENT TRUE
>   IMAGECOLOR 239 235 231
>   SHAPEPATH "C:\ms4w\apps\ka-map-1.0\mapdata\xxxxx\"
>   IMAGETYPE AGGA
>   CONFIG "PROJ_LIB" "C:\ms4w\proj\nad\"
>
>   WEB
> IMAGEPATH 'C:\ms4w\apps\ka-map-1.0\htdocs\xxxxx\tmp\'
> IMAGEURL 'C:\ms4w\apps\ka-map-1.0\htdocs\xxxxx\tmp\'
>   END
>
>   PROJECTION
> "init=epsg:23029"
>   END
>
>   REFERENCE
> EXTENT 559273 4709373 584263 4737543
> SIZE 193 236
> IMAGE
> 'C:\ms4w\apps\ka-map-1.0\htdocs\xxxxx\css\img\keymap.gif'
>   END
>
> LEGEND
> STATUS ON
> KEYSPACING 5 10
> KEYSIZE 20 12
> IMAGECOLOR 255 255 255
> LABEL
>   TYPE TRUETYPE
>   FONT bluehigh
>   COLOR 0 0 0
>   OUTLINECOLOR 254 254 254
>   SIZE 12
> END
> END
>
>   OUTPUTFORMAT
>     NAME 'AGGA'
>     DRIVER AGG/PNG
>     IMAGEMODE RGBA
>     FORMATOPTION "TRANSPARENT=ON"
>     #TRANSPARENT ON
>   END
>
> ##################
> #SYMBOL DEFINITION
> ##################
>
>   WEB
>      HEADER "tlg_header.xml"
>      FOOTER "tlg_footer.xml"
>   END
>
> #**************
> #MDT
> #**************
> LAYER
> NAME "MDT"
> STATUS DEFAULT
> GROUP "MDT"
> TYPE raster
> OPACITY 75
> #PROCESSING "SCALE=AUTO"
> PROCESSING "DITHER=YES"
> CLASS
> MINSCALE 15000
> END
> DATA "mdtxxxxx2.tif"
> END
>
> #**************
> #ORTOFOTO
> #**************
> LAYER
> NAME "ORTOFOTO"
> STATUS DEFAULT
> GROUP "ORTOFOTO"
> TYPE raster
> DATA "ortoxxxxx.ecw"
> #PROCESSING "SCALE=AUTO"
> PROCESSING "DITHER=YES"
> CLASS
> MAXSCALE 15000
> END
> END
>
>  ##################
>  #LAYERS DEFINITION
>  ##################
>
> END ## end Map
>
>
>
>
>
>
> -----Mensaje original-----
> De: Brent Fraser [mailto:bfraser at geoanalytic.com]
> Enviado el: martes, 19 de febrero de 2008 16:46
> Para: Hans Castorp
> CC: mapserver-users at lists.osgeo.org
> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>
> Hans,
>
>   That is stange.  I've tested mapserver 5.0.0. Beta 4 (it's
> the only v5 I've got compiled) and it gives me a 24 bit
> color image.  What version of Mapserver are you using?  Can
> you send your entire map file?
>
> Brent Fraser
> GeoAnalytic Inc.
> Calgary, Alberta
>
> ----- Original Message -----
> From: "Hans Castorp" <hanscastorp76 at yahoo.es>
> To: <bfraser at geoanalytic.com>
> Cc: <mapserver-users at lists.osgeo.org>
> Sent: Tuesday, February 19, 2008 2:21 AM
> Subject: RE: [mapserver-users] AGG_Q + raster problem
>
>
> Yes, I'm still getting a quantized image using this
> statement:
>
>   OUTPUTFORMAT
>    NAME 'AGG_PNG'
>    DRIVER AGG/PNG
>    IMAGEMODE RGB
>   END
>
> -----Mensaje original-----
> De: Brent Fraser [mailto:bfraser at geoanalytic.com]
> Enviado el: lunes, 18 de febrero de 2008 21:37
> Para: Hans Castorp
> CC: mapserver-users at lists.osgeo.org
> Asunto: RE: [mapserver-users] AGG_Q + raster problem
>
> So when you remove all the quantize options, you still get a
> quantized
> image on output?  Using something like:
>
>   OUTPUTFORMAT
>    NAME 'AGG_PNG'
>    DRIVER AGG/PNG
>    IMAGEMODE RGB
>   END
>
>
>
>> This, by example
>>
>>
>> -----Mensaje original-----
>> De: Guillaume Sueur
> [mailto:guillaume.sueur at neogeo-online.net]
>> Enviado el: lunes, 18 de febrero de 2008 19:04
>> Para: Hans Castorp; mapserver-users at lists.osgeo.org
>> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>>
>> what's the result in standard AGG mode ?
>>
>> Hans Castorp a écrit :
>>> The result is the same with or without this line...
>>>
>>>
>>> -----Mensaje original-----
>>> De: Guillaume Sueur
> [mailto:guillaume.sueur at neogeo-online.net]
>>> Enviado el: lunes, 18 de febrero de 2008 18:59
>>> Para: Hans Castorp
>>> CC: mapserver-users at lists.osgeo.org
>>> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>>>
>>> quantize_colors=255 is maybe the reason why your colors
> are reindexed on
>>> a 256 colors palette.
>>>
>>> Hans Castorp a écrit :
>>>> Thanks Brent, but there is a mistake, the example I
> attached is not the
>>>> mapservers original output: I have prepared it and give
> ......gif extensión.
>>>>
>>>> This is the way I configure my output:
>>>>
>>>>   OUTPUTFORMAT
>>>>     NAME 'AGG_Q'
>>>>     DRIVER AGG/PNG
>>>>     IMAGEMODE RGBA
>>>> FORMATOPTION "TRANSPARENT=ON"
>>>>     FORMATOPTION "QUANTIZE_FORCE=ON"
>>>>     FORMATOPTION "QUANTIZE_DITHER=OFF"
>>>>     FORMATOPTION "QUANTIZE_COLORS=255"
>>>>   END
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>>
>>>>
>>>> -----Mensaje original-----
>>>> De: Brent Fraser [mailto:bfraser at geoanalytic.com]
>>>> Enviado el: lunes, 18 de febrero de 2008 18:17
>>>> Para: Hans Castorp
>>>> CC: mapserver-users at lists.osgeo.org
>>>> Asunto: Re: [mapserver-users] AGG_Q + raster problem
>>>>
>>>> Hans,
>>>>
>>>>   GIF supports only 256 colors.  Use PNG (or JPG) for an
> output format.
>>>>
>>>> Brent Fraser
>>>>
>>>>> Hi to all,
>>>>>
>>>>>
>>>>>
>>>>> I'm trying to publish a cartography using both
> vectorial and raster
>>>>> layers.
>>>>> I'm using mapserver 5 and agg_q as output format. There
> is no problem
>>>>> about
>>>>> vectorial files (shapefiles): all work fine.
>>>>>
>>>>> The only problem I'm having is trying to publish some
> raster stuff: an
>>>>> aerial photo (.geotiff) and a digital terrain model
> (.ecw). I'm not
>>>>> capable
>>>>> to make the output showing real colours; there is an
> example attached
>>>>> to
>>>>> this mail (an aerial photo).
>>>>>
>>>>>
>>>>>
>>>>> My mapfile looks in this way:
>>>>>
>>>>>
>>>>>
>>>>> LAYER
>>>>>         NAME "MDT"
>>>>>         STATUS DEFAULT
>>>>>         GROUP "MDT"
>>>>>         TYPE raster
>>>>>         DATA "mdt.tif"
>>>>>         CLASS
>>>>>                MINSCALE 15000
>>>>>         END
>>>>> END
>>>>>
>>>>> LAYER
>>>>>         NAME "ORTOFOTO"
>>>>>         STATUS DEFAULT
>>>>>         GROUP "ORTOFOTO"
>>>>>         TYPE raster
>>>>>         DATA "ortofoto.ecw"
>>>>>         CLASS
>>>>>                MAXSCALE 15000
>>>>>         END
>>>>> END
>>>>>
>>>>>
>>>>>
>>>>> What I have to do to solve this?
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance to everyone.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Hans Castorp




More information about the mapserver-users mailing list