I've run into a problem when running queries with a large number of results (in 
my test case, over 1000 records, point locations, shape file).  After some 
testing, I found the problem wasn't the query itself- I did a queryByAttributes 
and it told me the records were selected within a couple seconds.  On further 
investigation, the problem seems to be when calling the processquerytemplate 
method.  The process takes a long time, often timing out beyond 30 seconds.  I 
am also suspicious that the result set is getting processed in such a way that 
we are reiterating over records.

Has anyone had a similar problem, and are there any suggestions ?

Here is a code excerpt, I hope it's enough to help...

$layer->queryByAttributes($queryItem,$queryExp,MS_MULTIPLE);
$numResults = $layer->getNumResults();
$layer->open();

for($i=0;$i<$layer->getNumResults();$i++){
    $shape=$layer->getShape($layer->getResult($i));
    $foundShapes[] = $shape;
    $fields = array();
    array_push($fields, 'wkt_geometry text');
    foreach($attributes as $attribute) {
                    array_push($fields, $attribute.' text');
    }
    array_push($results,$map->processquerytemplate(array(), false));

$layer->close();


_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to