Hi All,<br> I have wrote a small plugin which colors my map.The plugin colors the map if i have 1 instead of -1 in the <span style="font-weight: bold;">line 81 </span>of the following code and commented out <span style="font-weight: bold;">
line 108</span> with only single color.If i have got the following code then i was getting the following error.
<br> Can anyone help me in solving this error.And also what changes i have to make in order to solve this problem.<br> One more thing if if i have 1 instead of -1 in the <span style="font-weight: bold;">line 81
</span>and uncommentd <span style="font-weight: bold;">line 108 </span>then the map is either not displayed or some of the polygons are displayed.<br> Code and errors are as follows:<br><br> Thanks In advance,<br><br>
regards,<br>venu.<br><br><br>Errors:<br>------.<br> <br><pre style="border: 0pt none ;">Class : SoapFaultWrapper<br>Message : Mapserver error: Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error
<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression<br><br>Error in msyyparse(): syntax error<br><br>Error in msEvalExpression: Failed to parse expression
<br><br>Error in msyyparse(): syntax error<br><br><br>Backtrace:<br><br>file: 222 - C:\wamp\www\cartoweb3\coreplugins\images\server\ServerImages.php<br>call: ServerContext->checkMsErrors()<br><br>file: 305 - C:\wamp\www\cartoweb3\server\Cartoserver.php
<br>call: ServerImages->drawMainmap(Object(Images))<br><br>file: 337 - C:\wamp\www\cartoweb3\server\Cartoserver.php<br>call: Cartoserver->doGetMap(Object(MapRequest))<br><br>file: 358 - C:\wamp\www\cartoweb3\server\Cartoserver.php
<br>call: Cartoserver->callWithExceptionCheck("doGetMap", Object(MapRequest))<br><br>file: 81 - C:\wamp\www\cartoweb3\server\MapResultCache.php<br>call: Cartoserver->cacheGetMap(Object(MapRequest))<br><br>
file: 192 - C:\wamp\www\cartoweb3\server\MapResultCache.php<br>call: MapResultCache->getMapResultFromServer(Object(MapRequest))<br><br>file: 368 - C:\wamp\www\cartoweb3\server\Cartoserver.php<br>call: MapResultCache->getMap(Object(MapRequest))
<br><br>file: 104 - C:\wamp\www\cartoweb3\client\CartoserverService.php<br>call: Cartoserver->getMap(Object(MapRequest))<br><br>file: 158 - C:\wamp\www\cartoweb3\client\CartoserverService.php<br>call: CartoserverService->callDirect("getMap", Object(MapRequest))
<br><br>file: 226 - C:\wamp\www\cartoweb3\client\CartoserverService.php<br>call: CartoserverService->callFunction("getMap", Object(MapRequest))<br><br>file: 776 - C:\wamp\www\cartoweb3\client\Cartoclient.php<br>
call: CartoserverService->getMap(Object(MapRequest))<br><br>file: 892 - C:\wamp\www\cartoweb3\client\Cartoclient.php<br>call: Cartoclient->getMapResultFromRequest(Object(MapRequest))<br><br>file: 1027 - C:\wamp\www\cartoweb3\client\Cartoclient.php
<br>call: Cartoclient->doMain()<br><br>file: 38 - C:\wamp\www\cartoweb3\htdocs\client.php<br>call: Cartoclient->main()<br><br>file: 3 - C:\wamp\www\cartoweb3\htdocs\chittoor.php<br>call: require_once("C:\wamp\www\cartoweb3\htdocs\client.php")
<br><br>My code Is as follows:<br>---------------------<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<105;$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>                $resultArray = $this->getValues($requ->dataElement_id);
<br>                $this->log->debug("resu arr".$resultArray."and " .count($resultArray));<br>                $msLayer = $msMapObj->getLayerByName("chittoor");<br>                $no_intervals = 9;<br>                $color = "Reds"; //dont't think this is necessary
<br>                $this->colorMapFromData($resultArray, $msLayer, $no_intervals, $color);        <br>        }<br>        <br>        public function buildClassExpressions($numberOfIntervals,$resultArray)<br>        {<br>                $max_val = max($resultArray);<br>                $this->log->debug("max_val".$max_val);
<br>                $min_val = min($resultArray);<br>                $this->log->debug("min_val".$min_val); <br>                $intervalLength = ceil(($max_val - $min_val)/$numberOfIntervals);<br>                $this->log->debug("intervallength".$intervalLength);
<br>                $idsPerClass = array();<br>                $cn = array(); //addin<br>                <br>                for($i=0;$i < $numberOfIntervals+1;$i++) //added this loop1<br>                {<br>                        $idsPerClass[$i]= "([".$this->getConfig()->id_col . "] IN ";        
<br>                }<br>                $i = 0;<br>                foreach($resultArray as $id => $value)<br>                {<br>                        $classNo = floor($value/$intervalLength);<br>                        $cn[$i] = $classNo; //add in<br>                        $i = $i + 1;<br>                        $idsPerClass[$classNo] .= $id.",";
<br>                        $this->log->debug("hello buildclassex ids per c".$idsPerClass[$classNo]);<br>                }<br>                $this->log->debug("hai this is i".$i);<br>                <br>                $classes = array();<br>                $idcol = $this->getConfig()->id_col;
<br>                $this->log->debug("hello idcol".$idcol."and ".count($idcol));<br>                        <br>                for($i=0;$i < $numberOfIntervals;$i++)<br>                {<br>                        if ($cn[$i])                 //classNO->cn<br>                        {
<br>                                //$classIds = substr($cn[$i],0,-1);<br>                                $classIds = substr($idsPerClass[$classNo],0,-1); //added1 i->classNo<br>                                $this->log->debug("classids".$classIds);<br>                        }<br>                        else
<br>                                $classIds = "";<br>                                        <br>                //         $classes[$i] = "([".$idcol. "] IN '" . $classIds . "')";<br>                         $classes[$i] = $classIds .")";<br>                         $this->log->debug("classes[i]".$classes[$i]);
<br>                         <br>                }<br>                return $classes;                <br>        }<br>        <br>        public function colorMapFromData($resultArray, $msLayer, $numberOfIntervals, $colorScheme)<br>        {<br>                $expressions = $this->buildClassExpressions($numberOfIntervals,$resultArray);
<br>                $r = 100;<br>                $g = 175;<br>                $b = 255;<br>                //$msLayer->removeClass(0);<br>                for($i=0;$i<$numberOfIntervals;$i++)<br>                {        <br>                         $msLayer->removeClass(0);<br>                         $msClass = ms_newClassObj($msLayer);<br>
                        $msClass->setexpression($expressions[$i]);        //i->j<br>                        //$this->log->debug("Value of Value is" .$expressions[$i]);<br>                        $this->log->debug("expressions[".$expressions[$i]); <br>                        $msStyle = ms_newStyleObj($msClass);
<br>                        $this->log->debug("hellohai");<br>                        $msStyle->outlinecolor->setRGB(100,175,250);<br>                        $msStyle->color->setRGB($r,$g,$b);<br>                        $r = $r + 10;<br>                        $g = $g + 3;<br>                        $b = $b -10;<br>                }
<br>        }<br>}<br>?><br></pre>