Internal Server Error by queryByShape()

Camden Daily cdaily at GMAIL.COM
Fri Mar 25 13:09:51 EST 2005


Have you tried simply drawing your shape on the map to make sure it's
what you think it should be?  Your 'for' loop looks like it may have
an 'off by 1' error, as you start at 0, and then check for less than
your array size -1.  With that loop, you'll never hit the very last
element in the arXCoords array.  Since I believe a polygon shape
should have the first and last points being the same (to close it up),
your shape may not be getting properly closed.

Just a thought.

-Camden


On Fri, 25 Mar 2005 18:40:39 +0100, Richard Barahona
<richard at barahona.ch> wrote:
> Hi list,
> I don't if the function queryByShape has a problem or i am doing something
> wrong, but the result is an Internal Server Error (php crashes). He is the
> piece of my code (php-mapscript):
>
> $oshape = ms_newShapeObj(MS_SHAPE_POLYGON);
> $oline = ms_newLineObj();
>
> for($i=0; $i < sizeof($arXCoords)-1; $i++)
> {
>  $opoint = ms_newPointObj();
>  $opoint->setXY($arXCoords[$i],$arYCoords[$i]);
>  $oline->add($opoint);
> }
>
> $oshape->add($oline);
> $oshape->set('classindex',1);
> $oshape->set('text','99');
>
> $olayer = $_SESSION['oMap']->getlayerbyname("awp");
>
> $brc = $olayer->querybyshape($oshape);
>
> The shape object extent are set to -1, but the attribute numline is set to
> 1. Strange.
>
> Any solution? Thanks for your help.
>



More information about the mapserver-users mailing list