[ka-Map-users] Re: Ka-map and AGG + Alpha? - Solved (need confirm)
Lorenzo Becchi
lorenzo at ominiverdi.com
Fri Mar 14 18:17:31 EDT 2008
Hi Ritesh,
have you tried a phpinfo() function and checked if AGG is really in the
output list?
maybe you have compiled fine mapserver but not updated the php_mapscript.so
just an idea...
Lorenzo
ritesh.linux at gmail.com wrote:
> Dear Lorenzo,
>
> Thanks for the useful wiki page. Its all worth attempt of yours and Sacha. I am also in the middle of solving agg problem for my map service. Even after following the instructions and changes I am facing the same problem.
>
> I am not getting any issues with transparency or colors. The error is consistent :
>
> "Warning: [MapServer Error]: loadOutputFormat(): OUTPUTFORMAT clause references driver AGG/PNG, but this driver isn't configured."
>
> How can I solve this problem? The mapserver version which i have compiled on linux shows AGG support. I have modified tile.php, config.php and .map file according to the discussion you people did.
>
> Please help me to solve this issue. I will be really grateful to you.
> Regards,
> Ritesh Ambastha
>
> Regards,
> Ritesh
> Lorenzo Becchi wrote:
>
>> Sacha, all, I've created a wiki page for AGG support:
>>
>> http://ka-map.ominiverdi.org/wiki/index.php/AGG_support
>>
>>
>> I'll check the patch and submit to CVS asap
>>
>> thanks
>> Lorenzo
>>
>>
>>
>>
>>
>> Sacha Black wrote:
>>
>>> Yes, you are right... the badly formatted comment just wrapped around
>>> to the next line because of my email program.
>>>
>>> The comment can be deleted entirely leaving:
>>>
>>> elseif (strtoupper($_REQUEST['i']) == 'AGGA') {
>>> $useAlphaCh = true;
>>> }
>>>
>>> hope this helps,
>>>
>>> Sacha
>>>
>>>
>>> On Tue, Mar 11, 2008 at 11:35 PM, riteshambastha <ritesh.linux at gmail.com>
>>> wrote:
>>>
>>>> Hey Sahca,
>>>> thanks for sharing such helpful information.
>>>> Still I am facing some problems. Kindly check this part of the code and
>>>> see
>>>> :
>>>>
>>>>
>>>> elseif (strtoupper($_REQUEST['i']) == 'AGGA') { /// <-- also use
>>>> AlphaCh if AGGA
>>>> $useAlphaCh = true;
>>>> }
>>>>
>>>> I think "AlphaCh if AGGA" must be commented.
>>>>
>>>> <snip>
>>>>
>>>> /////// in tile.php (around line 85): /////////////////
>>>>
>>>> $useAlphaCh = false;
>>>> if (isset($_REQUEST['i'])) {
>>>> setOutputFormat( $_REQUEST['i'] );
>>>> if (strtoupper($_REQUEST['i']) == 'ALPHA') {
>>>> $useAlphaCh = true;
>>>> }
>>>> elseif (strtoupper($_REQUEST['i']) == 'AGGA') { /// <-- also use
>>>> AlphaCh if AGGA
>>>> $useAlphaCh = true;
>>>> }
>>>> }
>>>> </snip>
>>>>
>>>> Let me know if am not in the right direction.
>>>> Thanks,
>>>> Ritesh
>>>>
>>>>
>>>>
>>>> Sacha Black wrote:
>>>> >
>>>> > Hans, Zak, Paul, Lorenzo,
>>>> >
>>>> > Thanks for your comments - think I finally got the AGG + Alpha (AGGA)
>>>> > option to work. Hans maybe you can test the below and confirm?
>>>> >
>>>> > I hope it works for you....
>>>> >
>>>> > Sacha
>>>> >
>>>> > +++++++++
>>>> >
>>>> > [After Zak's last comment I realized that Paul's suggested code was
>>>> > not being executed in tile.php, because the condition "if
>>>> > ($useAlphaCh)" was never true, after that was fixed, everything
>>>> > worked]
>>>> >
>>>> > here is the full set of what worked for me (the bottom 2 changes were
>>>> > the final key):
>>>> >
>>>> > ///////////////// in the .map file: /////////////////
>>>> >
>>>> > OUTPUTFORMAT
>>>> > NAME 'AGGA'
>>>> > DRIVER AGG/PNG
>>>> > IMAGEMODE RGBA
>>>> > # FORMATOPTION "TRANSPARENT=ON"
>>>> > END
>>>> >
>>>> > and also for the relevant LAYER:
>>>> >
>>>> > LAYER
>>>> > METADATA
>>>> > "IMAGEFORMAT" "AGGA"
>>>> > END
>>>> > ....
>>>> > END
>>>> >
>>>> > /////// in config php (around line 105): /////////////////
>>>> >
>>>> > $aszGMap = array (
>>>> > 'title' => 'GMap 75',
>>>> > 'path' => '../../gmap/htdocs/gmap_AGGA.map',
>>>> > 'scales' => array( 40000000, 25000000, 12000000, 7500000,
>>>> > 3000000, 1000000 ),
>>>> > 'format' =>'PNG' /// <!-- doesn't seem to have an effect
>>>> -->
>>>> > );
>>>> >
>>>> > and (around line 210):
>>>> >
>>>> > case "AGGA":
>>>> > $GLOBALS['szMapImageFormat'] = 'AGGA';
>>>> > $GLOBALS['szMapImageCreateFunction'] =
>>>> "imagecreatefrompng";
>>>> > $GLOBALS['szImageExtension'] = '.png';
>>>> > $GLOBALS['szImageCreateFunction'] =
>>>> "imagecreatetruecolor";
>>>> > $GLOBALS['szImageOutputFunction'] = "imagepng";
>>>> > $GLOBALS['szImageHeader'] = 'image/png';
>>>> > break;
>>>> >
>>>> >
>>>> > /////// in tile.php (around line 85): /////////////////
>>>> >
>>>> > $useAlphaCh = false;
>>>> > if (isset($_REQUEST['i'])) {
>>>> > setOutputFormat( $_REQUEST['i'] );
>>>> > if (strtoupper($_REQUEST['i']) == 'ALPHA') {
>>>> > $useAlphaCh = true;
>>>> > }
>>>> > elseif (strtoupper($_REQUEST['i']) == 'AGGA') { /// <-- also
>>>> use
>>>> > AlphaCh if AGGA
>>>> > $useAlphaCh = true;
>>>> > }
>>>> > }
>>>> >
>>>> > and lastly the fix from Paul (around line 315):
>>>> >
>>>> > if ($useAlphaCh) {
>>>> > imageAlphaBlending($oTile, false);
>>>> > imagefill($oTile, 0, 0, imagecolorallocatealpha($oTile, 0, 0, 0,
>>>> > 127));
>>>> > imageSaveAlpha($oTile, true);
>>>> > }
>>>>
>>>>
>>>>> _______________________________________________
>>>>>
>>>> > ka-Map-users mailing list
>>>> > ka-Map-users at lists.maptools.org
>>>> > http://lists.maptools.org/mailman/listinfo/ka-map-users
>>>> >
>>>> >
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Ka-map-and-AGG-%2B-Alpha----Solved-%28need-confirm%29-tp15973299p15998643.html
>>>> Sent from the ka-map-users mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ka-Map-users mailing list
>>>> ka-Map-users at lists.maptools.org
>>>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>>>
>>>>
>>> _______________________________________________
>>> ka-Map-users mailing list
>>> ka-Map-users at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>>
>> _______________________________________________
>> ka-Map-users mailing list
>> ka-Map-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>>
>>
>>
> Quoted from:
> http://www.nabble.com/Ka-map-and-AGG-%2B-Alpha----Solved-%28need-confirm%29-tp15973299p15999817.html
>
>
More information about the ka-Map-users
mailing list