[Mapserver-users] mapserver 4.0 : queryByRect problem

fx gamoy fx.gamoy at mapxplore.com
Mon Sep 29 11:04:48 EDT 2003


C'est un message de format MIME en plusieurs parties.

------=_NextPart_000_0043_01C386A3.6892D3B0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hello,
i ve got a problem with the querybyrect method with mapserv4.0

for ($i=3D0;$i<$nblayer;$i++)
{
$oLayer =3D $oMap->getLayer( $i );
          if (@$oLayer->queryByRect($oRect) =3D=3D MS_SUCCESS)
    {
$oLayer->open();

     $szResults=3D$oLayer->getNumResults();
     if ( $szResults > 0)  //i find 14 shapes
     {
           for ($j=3D0;$j<$szResults;$j++)
          {
           $oResults=3D$oLayer->getResult($j);
           =
$oShape=3D$oLayer->getShape($oResults->tileindex,$oResults->shapeindex);
           $oShape->free();
          }
     }// if ( $szResults >0
     $oLayer->close();
    } //if (@$oLayer->quer=20
}// for
i find 14 shapes but the getshape method crash
PHP Fatal error:  [MapServer Error]: msOGRLayerNextShape(): Assertion =
failed: OGR layer not opened!!!
Any idea?
thanks=20
fx

------=_NextPart_000_0043_01C386A3.6892D3B0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i ve got a problem with the querybyrect =
method with=20
mapserv4.0</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>for =
($i=3D0;$i&lt;$nblayer;$i++)<BR>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$oLayer =3D $oMap-&gt;getLayer( $i =
);</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if=20
(@$oLayer-&gt;queryByRect($oRect) =3D=3D=20
MS_SUCCESS)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>$oLayer-&gt;open();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$szResu=
lts=3D$oLayer-&gt;getNumResults();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if=20
( $szResults &gt; 0)&nbsp; //i find 14=20
shapes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for=20
($j=3D0;$j&lt;$szResults;$j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$oResults=3D$oLayer-&gt;getResult($j);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$oShape=3D$oLayer-&gt;getShape($oResults-&gt;tileindex,$oResults-&gt;shap=
eindex);</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$oShape-&gt;free();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}// if ( $szResults=20
&gt;0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$oLayer-&gt;close();<BR>&nbsp;&nbs=
p;&nbsp;&nbsp;}=20
//if (@$oLayer-&gt;quer&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}// for</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i find 14 shapes but the getshape =
method=20
crash</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>PHP Fatal error:&nbsp; [MapServer =
Error]:=20
msOGRLayerNextShape(): Assertion failed: OGR layer not opened!!!<BR>Any=20
idea?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>fx</FONT></DIV></BODY></HTML>

------=_NextPart_000_0043_01C386A3.6892D3B0--




More information about the mapserver-users mailing list