[mapserver-users] problem with processquerytemplate and large selection sets
Lime, Steve D (MNIT)
Steve.Lime at state.mn.us
Tue Apr 23 09:55:47 PDT 2013
What does the template look like? --Steve
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Bistrais, Bob
Sent: Friday, April 19, 2013 3:29 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] problem with processquerytemplate and large selection sets
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();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130423/acad2e60/attachment.htm>
More information about the MapServer-users
mailing list