[mapserver-users] queryByAttribute()

Robert Burgholzer rburghol at vt.edu
Sat Apr 27 13:46:25 EDT 2002


> then get your results like:
>
> for ($i=0; $i<$layer->{resultcache}->{numresults}; $i++) {
>     $result = $layer->getResult($i);
>     ... (do something with the result)
> }

OK, I been lurking on this question, nd I really want to know some of the secrets too. I got as far as
getting the result as indicated below (although I am using PHP mapscript), but it is the "do something
with result" part which has me stumped. I can not get any action out of any of the variables listed in
the php mapscript documentation for result, and trying to fetch each of the results by using
$thisresult->next() gives me an "Fatal error:  Call to undefined function:  next()" error.

basically, I am trying to iterate through each shape in a given layer, and do such things as query for
adjacent neighbors, in the fashion of a neighborhood function. Any help would be appreciated. By the way,
my query .numresult gives me the number of shapes int eh layer, which makes me think things are going OK
till then. Code is as follows:

$lq = $thislayer->queryByAttributes(MS_MULTIPLE);
          $ni = $thislayer->getNumResults();
          $res = $thislayer->getResult($lq);
          $rsi = $res->numresults;
          $rti = $res->numquerylayers;
          $restr = $res->next();


--
Robert Burgholzer
al·go·rithm  n.
       A step-by-step problem-solving procedure, especially an established, recursive computational
       procedure for solving a problem in a finite number of steps. Invented by Al Gore.
rburghol at vt.edu
http://www.soulswimmer.net/





More information about the mapserver-users mailing list