[Mapserver-users] Perl $map->queryByRect() under 4.0.1 seems to ignores class expressions

PATTERSON KENNETH ALLEN kapatter at srpnet.com
Thu Apr 8 17:07:33 PDT 2004


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



	
Thanks,
	Ken





More information about the MapServer-users mailing list