[Mapserver-users] question re Perl queryByShape

Puneet Kishor pkishor at geoanalytics.com
Mon Sep 22 09:59:52 EDT 2003


as I understand, here's the logic for querying by shape --

1. create a shape to query with (queryShpObj)

	my $queryShpObj = new blah blah;

2. call queryByShape on the map object (mapObj) using the above shape

	$mapObj->queryByShape($queryShpObj);

Now, herein lies my question -- how does mapobject know which layer to 
query against? The intuitive model that I have learned (the Pavlovian 
Arcview way) is that you have first choose a layer before you can query 
against it. Even if we extend that model, we can make it plural... 
choose the layer or layers against which to query. So the syntax should 
be somewhat like
	my $queryLayerObj = new blah blah (proabably with a getLayerByName);
	$mapObj->queryByShape($queryShpObj, $queryLayerObj);

Once that is done then one could(should) work with the $resultCacheObj

	my $resultCacheObj = $queryLayerObj->{resultcache};

Not specifying the queryLayer(s) in step 2 above -- doesn't that make 
things slower?




More information about the mapserver-users mailing list