How to use queryByShape

Burgholzer,Robert rwburgholzer at DEQ.VIRGINIA.GOV
Wed Jun 20 11:23:48 EDT 2007


At you need to explicitly pass the shape of the selected elements of
your overlay shape, something like:

$ret=$layerPoints->queryByShape($ShapeAreaObject->getShape(-1,$shapeid))
;

HTH,
r.b.

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Nico Alberti
Sent: Wednesday, June 20, 2007 10:35 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] How to use queryByShape

Hi everybody. I am quite new to php_mapscript, so excuse me if the
question is lame.

I am trying to select which points of a shape are inside a particular
area, (a  shape from a polygon shapefile), so I do something like
this, after having instantiated the objects:

$map->prepareQuery();
$ret=$layerPoints->queryByShape($ShapeAreaObject);

However, even if I am sure that some points fall within the area of
$ShapeAreaObject, nothing is selected. It seems I am missing
something, but after having read the documentation and the list, I did
not find any clue. Using the php_ogr extension, the points that fall
within the area (or better its envelope) are correctly selected, but,
again, it is certainly my fault, as it's the first time I use this
library.

Any help will be greatly appreciated, thank you in afvance
-- 
Ciao
Nico



More information about the mapserver-users mailing list