Spatial query & scale

Chris Barber chris.p.barber at GMAIL.COM
Wed May 10 15:25:39 PDT 2006


Howdy all

I've searched around the archive looking for this and come up empty, so
apologies if this has come up before.

I'm using PHP/Mapscript in an application to select features in one Postgis
layer that intersect a selected feature of another layer. The first layer is
comprised of non-adjacent polygons and the second is country boundaries. I'm
finding that the number of returned features tends to vary with scale, where
at a "country display" scale I can see a few features just outside the
country boundary that are selected. As I zoom in, these extra features drop
off the list to the true desired set, and as I zoom out more "outside"
features are included in the results. The result set is not related to map
extent.

With some extraneous code removed (probably not the most elegant):
$cntry_layer->setFilter("gid = ".$fid);
$search_shp = $cntry_layer->getShape(-1,$fid);
$poly_layer->queryByShape($search_shp);

Are there scale-dependent considerations to getShape()? Any input on where
in the process this may be happening?

Mapserver: 4.8.1
Postgres: 8.1.3
Postgis: 1.1.1
GEOS: 2.2.1
Linux x86_64 2.6.9-22

Thanks for any input
Cheers!

Chris Barber
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060510/18811e5c/attachment.htm>


More information about the MapServer-users mailing list