How to use queryByFeatures?

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Jul 31 02:18:21 EDT 2006


pb: You need to pass the layer index of the selection layer not the
layer itself- a quirk in the API. In perl you'd do:

  $ciemi->queryByFeatures($pagasti->{index});  

I'm sure something similar would work in PHP as well...

Steve

>>> ?ISO-8859-13?Q?P=E7teris_Br=FBns?= <peteris.bruns at GMAIL.COM>
07/27/06 1:04 PM >>>
Hi folks,

I started to play with php5-mapscript and could not understand how
layer->queryByFeatures() works.

Here is sample from my php script:
<?php
$pagasti = $Map->getLayerByName("pagasti");
$ciemi = $Map->getLayerByName("ciemi");
$pagasti->queryByPoint($point,MS_MULTIPLE,1000.0);
$ciemi->queryByFeatures($pagasti);
?>

and output is: Warning: [MapServer Error]: msQueryByFeatures():
Selection
layer has not been queried.

Any links to FM's or other hints?

Bottom line.
I added output of layer->resultcache->numresults at mapquery.c - here
comes
most interesting part - if I call 2 times queryByPoint(), then at second
time
there is layer->resultcache variable, but when I call queryByPoint() and
then
pass layer as slayer to queryByFeatures(), slayer has NO resultcache
variable.

My system:
Kubuntu 6
kernel 2.6.15
Apache 2.0.55
PHP 5.1.2
PHP5-mapscript 4.6.1
-- 
pb



More information about the mapserver-users mailing list