[mapserver-users] php queryByPoint

Daniel Morissette morissette at dmsolutions.ca
Sat Sep 8 11:12:50 EDT 2001


> Aaron Hunt wrote:
> 
> I am trying to use php mapscript to query a map file using
> queryByPoint and all I ever get is
> "Warning: MapServer Error in msQueryByPoint(): No matching record(s)
> found. "
> Can anyone help me, or direct me to some examples, with querying and
> displaying the results.
> 

Your code seems to do the right thing... I would suggest that you check
the following:

1- Did you set a TEMPLATE parameter in the queryable layer(s) or in
their CLASSes?

2- Is there really something at the location ($lat, $lon) that you are
querying?  Is your data in lat/lon as well? (i.e. the query coordinates
have to be in the same projection as the map itself).  Try a
queryByRect() with the whole view extent and see if that returns
something.

3- Have you tried increasing the TOLERANCE value?


Finally, the GMap PHP demo contains example of querying and displaying
results:
http://www2.dmsolutions.ca/mapserver/dl/gmap-ms35-20010726.tar.gz

The querying happens at the end of GMap75CheckClick(), around line 500
in gmap75.php3, and displaying the results is all handled in the
function GMapDumpqueryResults() which is in the same file.

-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the mapserver-users mailing list