[ka-Map-users] Think There is a bug in map_query_float.php

Steve Walker walker at mfgis.com
Tue Jun 19 15:23:19 EDT 2007


I would like to follow up on this thread from March, as I have found what
may be the same or a related problem.  The thread appears to have died
without resolution, I've repeated it below.

The problem I have discovered (whether the same or different) arises when
there are two or more search-able, scale-dependent themes within the same
GROUP.  (In my case, the motivation was to represent the same data, yet
have  its symbol change from a point to an image when the zoom level was
large enough.)

Schematically (not actually) the relevant parts of the map file looks like:

THEME
  NAME POINT1
  GROUP SEARCHPOINT
  MINSCALE 1
  MAXSCALE 10010
  ...
  METADATA
   'queryable' 'true'
  END
END

THEME
  NAME POINT2
  GROUP SEARCHPOINT
  MINSCALE 10011
  ...
  METADATA
   'queryable' 'true'
  END
END

At any given scale, only one of the two will be visible, and it would be
hoped that only one would be queryable.  I am guessing that by sharing a
GROUP name, map_query_float.php is making all of the layers within the
GROUP queryable.

Depending upon (some factor which I have not determined) the results of
such a query will either be a duplicate set of results OR an error message
of the effect "msQueryByRect() no matching records found in
map_query_float.php on line 233"

The immediate solution is to not have multiple, scale-dependent searchable
themes within the same GROUP.

A more robust solution may be found in map_query_float.php beginning
around line 172 and especially at about line 180 which seems to be turning
a layer's visibility on (for querying?)

$oLayer->set('status',MS_ON);

If I am reading the code correctly (a BIG if) it seems the layer is being
queried if any members of its GROUP are visible.

-Steve



ORIGINAL THREAD:

On Thu Mar 8 10:56:37 EST 2007
Stéphane RIFF stephane.riff at cerene.fr wrote:

<quote>
I think I found a little bug in the map_query_float.php :

If there are more than one layer queryed there is an error in rendering 
the second one results.

The problem come from map_query_float.php line 227 ($oResultCache = 
$oLayer->getResult($a);)

For the first layer it works because $a is undefined but for the other 
ones $a is the to numresult-1 of the first layer.
So for the second layer $oResultCache = $oLayer->getResult($a); can 
return FALSE

The workaround I found is to replace line 227 ($oResultCache =
$oLayer->getResult($a);) in map_query_float.php by :

$oResultCache = $oLayer->getResult(0);

It seems to work for me, maybe it's a bad workaround let me know about this.
</quote>

Then,
on Thu Mar 8 11:24:16 EST 2007
Lorenzo Becchi lorenzo at ominiverdi.com replied:
<quote>
Stéphane
you are right, I had a quick look to map_query_float.php
that $a is not defined before in that code.
</quote>





-- 
Steve Walker
Middle Fork Geographic Information Services
walker at mfgis.com
360-671-2505






More information about the ka-Map-users mailing list