[mapserver-dev] PHP Mapscript - Differences between whichShape and queryByShape

Nicol Hermann mapserver at geoworld.de
Sun Mar 1 11:51:59 EST 2009


Hi Guillaume,

i attached a short sample script which executes both methods on the same
dataset.
The polygon is constructed from the coordinates of the rectangle.
Given this, i would expect the same number of query results from both
methods.
But this is not the case:
whichShapes returns 2673 records while queryByShape returns 2695
records.
Can someone explain which this is the case?

Best regards
Nicol


Am Samstag, den 28.02.2009, 20:48 +0100 schrieb Guillaume Sueur:
> Hi Nicol,
> 
> In the first case, whichShapes uses a rectObj, where the queryByShape
> will use any kind of polygon. But I would be interested in knowing the
> difference between whichShapes and queryByRect ! Does whichShapes
> compute the intersection of bounding boxes instead of shapes themselves ?
> 
> Regards,
> 
> Guillaume
> 
> 
> Nicol Hermann a écrit :
> > Hello Devs,
> > 
> > i have a question concerning the function of the method
> > $layer->whichShapes($Map->extent);
> > of PHP mapscript.
> > As far as i understand the documentation
> > (http://mapserver.org/mapscript/php/) the method returns all shapes
> > within a given area (in this case $Map->extent).
> > I wonder what are the differences to the method
> > $layer->queryByShape( $shpobj );
> > $shpobj is defined as 'MS_SHAPE_POLYGON' and is constructed with the
> > same values like $Map->extent
> > To my understanding both methods should return the same number of query
> > results.
> > Is this assumption correct?
> > Many thanks for your assistance.
> > 
> > best regards
> > Nicol
> > 
> > _______________________________________________
> > mapserver-dev mailing list
> > mapserver-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-dev
> > 
> > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check.zip
Type: application/zip
Size: 872 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20090301/fc7ea752/check.zip


More information about the mapserver-dev mailing list