<br>Hi Group/ Pierre GIRAUD/Damien,<br> I am very much thankful for your valuabel suggestions.I got my problem solved with the help of your suggestion.The problem occured because of the extra lines after my code. I think it should not be a problem because nothing written in those lines after my
code.Any way after removing those extra lines i got my error rectified.<br> Thanking you once again.<br><br>Regards,<br>venu.<br><div><span class="gmail_quote">On 3/9/06, <b class="gmail_sendername">Pierre GIRAUD
</b> <<a href="mailto:pierre.giraud@camptocamp.com">pierre.giraud@camptocamp.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I didn't take a look at your code but the error you sent us isn't really<br>explicit.<br>Probably, you have an "echo" or "print_r" somewhere that prevent the<br>error to display correctly.<br><br>Are you able to check this and send back the real error message on this
<br>list ?<br><br>Regards<br><br>Pierre GIRAUD<br><br><br>VenuGopal Papasani wrote:<br><br>> Hi,<br>> I have written a plugin which colors the polygon of my map.The<br>> following is the code wriiteen for<br>> c:\wamp\www\cartoweb3\plugins\ctr\server\ServerCtr.php.
<br>><br>> Before this code there was no problem with the map the map is<br>> displaying after writing this I was getting the following exception.<br>><br>> I have also made one more changes previously my project
<br>> name is ctr and i used to execute it as <a href="http://ctr.php.As">ctr.php.As</a><br>> <<a href="http://ctr.php.As">http://ctr.php.As</a>> my plugin name and my project names are same i<br>> changed it to chittoor.
<br>><br>> Now I want to know where the problem actually is.Is it in the<br>> code or in Renaming my file names.No doubt i have renamed everything<br>> required.<br>><br>> The Exception is
<br>><br>><br>> *Fatal error*: Uncaught exception 'CartocommonException' with message<br>> 'Error [2, Cannot modify header information - headers already sent by<br>> (output started at<br>> C:\wamp\www\cartoweb3\plugins\ctr\server\ServerCtr.php:123),
<br>> C:\wamp\www\cartoweb3\client\FormRenderer.php, 301] Backtrace: file:<br>> UNKNOWN - UNKNOWN call: Common::cartowebErrorHandler(2, "Cannot modify<br>> header information - headers already sent by (outp...",
<br>> "C:\wamp\www\cartoweb3\client\FormRenderer.php", 301, Array(1)) file:<br>> 301 - C:\wamp\www\cartoweb3\client\FormRenderer.php call:<br>> header("HTTP/1.1 500 Internal Server Error") file: 1032 -
<br>> C:\wamp\www\cartoweb3\client\Cartoclient.php call:<br>> FormRenderer->showFailure(Object(SoapFaultWrapper)) file: 38 -<br>> C:\wamp\www\cartoweb3\htdocs\client.php call: Cartoclient->main()<br>> file: 3 - C:\wamp\www\cartoweb3\htdocs\chittoor.php call:
<br>> require_once("C:\wamp\www\cartoweb3\htdocs\client.php") ' in<br>> C:\wamp\www\cartoweb3\common\Common.php:275 Stack trace: #0 [internal<br>> function]: Common::cartowebErrorHandler(2, 'Cannot modify h... in
<br>> *C:\wamp\www\cartoweb3\common\Common.php* on line *275*<br>><br>><br>> Here is my code<br>><br>> ServerCtr.php<br>> ------------------<br>> <?php<br>><br>> require_once(CARTOWEB_HOME . 'common/BasicTypes.php');
<br>> require_once('DB.php');<br>><br>> class ServerCtr extends ClientResponderAdapter<br>> implements InitProvider<br>> {<br>><br>><br>> private $log;<br>><br>> public function __construct()
<br>> {<br>> parent::__construct();<br>> $this->log =& LoggerManager::getLogger(__CLASS__);<br>> }<br>><br>><br>> public function getInit()<br>> {<br>> // Things to learn from the LayerInit
<br>> }<br>><br>> public function getValues($id)<br>> {<br>> $values = array();<br>> for($k=0;$k=1105;$k++)<br>> {<br>> $values[k] = rand(0,100);<br>
> }<br>> return $values;<br>> }<br>><br>> public function initializeRequest($requ)<br>> {<br>> $msMapObj = $this->serverContext->getMapObj();<br>><br>> $resultArray = $this->getValues($requ->dataElement_id);
<br>> $msLayer = $msMapObj->getLayerByName('chittoot');<br>> $no_intervals = 5;<br>> $color = "Reds"; //dont't think this is necessary<br>> $this->colorMapFromData($resultArray, $msLayer, $no_intervals,
<br>> $color);<br>> }<br>><br>> public function buildClassExpressions($numberOfIntervals,$resultArray)<br>> {<br>> $max_val = max($resultArray);<br>> $min_val = min($resultArray);
<br>> $intervalLength = ceil(($max_val - $min_val)/$numberOfIntervals);<br>> $idsPerClass = array();<br>> foreach($resultArray as $id => $value)<br>> {<br>> $classNo = floor($value/$intervalLength);
<br>> $idsPerClass[$classNo] .= $id. ",";<br>><br>> }<br>><br>> $classes = array();<br>> for($i=0;$i < $numberOfIntervals+1;$i++)<br>> {<br>> if ($classNo[$i])
<br>> $classIds = substr($classNo[$i],o,-1);<br>> else<br>> $classIds = "";<br>><br>> $classes[$i] = "([".$idcol. "] IN '" . $classIds .
<br>> "')";<br>> }<br>><br>> return $classes;<br>> }<br>><br>> public function colorMapFromData($resultArray, $msLayer,<br>> $numberOfIntervals, $colorScheme)<br>> {
<br>> $expressions =<br>> $this->buildClassExpressions($numberOfIntervals,$resultArray);<br>> $r = 10;<br>> $g = 10;<br>> $b = 10;<br>><br>> for($i=0;$i<numberOfIntervals;$i++)
<br>> {<br>> $msClass = ms_newClassObj($msLayer);<br>> $msClass->setexpression($expressions[$i]);<br>> $msStyle = ms_newStyleObj($msClass);<br>> $msStyle->color->setRGB($r,$g,$b);
<br>> $r = $r + 10;<br>> $g = $g + 10;<br>> $b = $b + 10;<br>> }<br>> }<br>> }<br>> ?><br>><br>><br>> ctr.ini consists of
<br>> id_col="ID"<br>><br>> Please give me the solution how to solve<br>> this problem.<br>> Thanks in Advance,<br>><br>> Regards,<br>
> Venu.<br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>
><br>><br>><br>><br>><br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________<br>>Cartoweb-users mailing list
<br>><a href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</a><br>><a href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users
</a><br>><br>><br><br><br>--<br>_________________________________________________________<br>Pierre GIRAUD<br>Géomaticien, Analyste<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>73377 Le Bourget du Lac, Cedex
<br><br>Tel : 00 33 4 79 44 44 93<br>Mail : <a href="mailto:pierre.giraud@camptocamp.com">pierre.giraud@camptocamp.com</a><br><a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br><br><br></blockquote></div>
<br>