[Mapserver-users] Perl $map->queryByRect() under 4.0.1 seems to ignores class expressions
Daniel Morissette
dmorissette at dmsolutions.ca
Sat Apr 10 10:27:11 PDT 2004
PATTERSON KENNETH ALLEN wrote:
> We are moving our Perl applications to 4.0.1. The result returned by queryByRect() and getResult() are a different set of data points compared to the (somewhat) similar app under 3.6.7. layer->getResult() seems to be returning every point within the extent ignoring the class expressions. What is the intent of queryByRect()? Should it reflect what will be drawn or what is available to be drawn? Are we missing something in the port that will dictate how queryByRect()/getResult() work? We have looked through the online docs and have found no reference to a different approach when using these methods.
>
> This is an example of what we have found: There may be 600 points in the shape file for the current extent but only 100 total that are drawn given the expressions in the classes. Unfortunately our the code creating the layers is somewhat different in 4.0.1 compared to 3.6.7. The code calling queryByRect() is the same. In 3.6.7 we only get back 100 points (just the ones that are drawn) while under 4.0.1 we get 600 (all of them). The number of point drawn in both versions are 100.
>
> In this application we create dynamic layer setting the shapefile and adding classes such that the expression subsets the data drawing different symbols. Not all classes are added. So the layer looks something like:
> layer
> type POINT
> name "gauges"
> template "dummy"
> ...
> class
> name "joes"
> ...
> symbol 'circle'
> expression ([db_nm] = "joes")
> end
> class
> name "sams"
> ...
> symbol 'square'
> expression ([db_nm] = "sams")
> end
> end
>
This is probably because you set your TEMPLATE at the layer level
instead of at the class level. I've also been surprised when I noticed
that the first time:
- If you set TEMPLATE at the layer level then all shapes in the file are
queried, even if they don't belong in any class.
- If you set TEMPLATE at the class level then only those classes that
have a template are included in the query.
Daniel
--
------------------------------------------------------------
Daniel Morissette dmorissette at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
More information about the MapServer-users
mailing list