queryByPoint on dynamic layer from mysql

Kristjan Annus kristjan at TARKVARASTUUDIO.EE
Sat Feb 18 17:14:57 EST 2006


Hello Doug

I had the same kind of problems with querying Mygis layers but thanks to 
your letter I figured at least out that the id field in the feature 
table is responsible for generating the shapeindex values. So it is 
possible to run a query with queryByPoint and then select the records 
with appropriate ID-s from the database and get the values for the data 
atributes to show to user.
My question is, that is it at all possible to use mapserver 
ProcessQueryTemplate functions with MyGis layers in PhpMapscript?

I allso tried to use MySQL geometry functions to locate the shapes that 
intersect with my querypoint but they seemed to work somehow randomly. 
For instance MySQL Intersects() function showed NO result for some 
shapes that where clearly in the centre of my querypoint and sometimes 
the same function returned YES for shapes that where just near the 
querypoint.
Does anyone in the list have some comments about this issue?

Kristjan

 > Hi,
 > Trying to query points that I have added to my map with php_mapscript 
from a
 > mysql table.
 > I've bumbled through the "set index" problem in older versions,
 > have installed MapServer 4.8.1,
 > and now seem to be able to get records from my query, but...
 > while the points and labels show up on the map properly,
 > indicating that the layer of points is being created and the lat/lon 
and label
 > values are associated properly,...
 > when I process the records obtained from my queryByPoint,
 > using getShape to get at the details,
 > There is no data in the shape object's members for the dynamic layer, 
although
 > the result objects from the point query do have the correct index 
values that
 > I programmatically set (incrementing from zero by 1 ... i tried 
incrementing
 > by five to see if index values needed to be 'just so', and that broke the
 > point query - yes, i believe they need to increment by one from zero).
 >
 >
 > Querying layers (from standard shape files added to the map from a 
mapfile)
 > with the same code works as expected. I can get a shapes member 
values with
 > either values() or getValue() ... works the same both ways.
 >
 >
 > It was not possible to query dynamically added points in phpmapscript 
in the
 > old version I last installed (4.4) because the index for the shapes was
 > readonly and incorrectly set to -1. Now I can set the index values 
and the
 > queryByPoint does grab the point, but the result record seems to have 
no data.
 > I must be doing something wrong.
 >
 >
 > Any help is greatly appreciated!



More information about the mapserver-users mailing list