[Mapserver-users] known issue: no results with QueryByPoint (Mapserver 3.7 PHP mapscript)

Michael Härtel mhaerte1 at gwdg.de
Wed May 21 04:41:33 PDT 2003


Hello All!

There are many references to articles about the problem that no results 
are returned by QueryByPoint.
i' ve read all of them but i still can't figure out why i get no results.

This is what i have:

1.) A Query Layer ($querylayer) with a template file:

object(layer)(35) { ["_handle_"]=>  resource(50) of type (layerObj) 
["_map_handle_"]=>  resource(1) of type (mapObj) ["numclasses"]=> 
int(0) ["index"]=>  int(7) ["status"]=>  int(0) ["classitem"]=> 
string(0) "" ["name"]=>  string(11) "WRS-2_frame" ["group"]=>  string(0) 
"" ["data"]=>  string(9) "wrs2/wrs2" ["type"]=>  int(2) ["tolerance"]=> 
  float(3) ["toleranceunits"]=>  int(6) ["symbolscale"]=>  float(-1) 
["minscale"]=>  float(-1) ["maxscale"]=>  float(-1) ["labelminscale"]=> 
  float(-1) ["labelmaxscale"]=>  float(-1) ["maxfeatures"]=>  int(-1) 
["transform"]=>  int(1) ["labelcache"]=>  int(1) ["postlabelcache"]=> 
int(0) ["labelitem"]=>  string(0) "" ["labelsizeitem"]=>  string(0) "" 
["labelangleitem"]=>  string(0) "" ["tileitem"]=>  string(8) "location" 
["tileindex"]=>  string(0) "" ["header"]=>  string(32) 
"H:\_webroot_\mapserv_header.html" ["footer"]=>  string(32) 
"H:\_webroot_\mapserv_footer.html" ["connection"]=>  string(0) "" 
["connectiontype"]=>  int(1) ["filteritem"]=>  string(0) "" 
["template"]=>  string(40) "H:\_webroot_\mapserv_query_template.html" 
["transparency"]=>  int(0) ["styleitem"]=>  string(0) "" ["offsite"]=> 
object(color)(4) { ["_handle_"]=>  resource(51) of type (Unknown) 
["red"]=>  int(-1) ["green"]=>  int(-1) ["blue"]=>  int(-1) } }

2.) A Point Object with geographic coordinates:

object(point)(4) { ["_handle_"]=>  resource(52) of type (Unknown) 
["x"]=>  float(9.85) ["y"]=>  float(50.9) ["m"]=>  float(50.9) }

3.) A call to Query function (with tolerance set in map file):

$query=$querylayer->QueryByPoint($my_point,MS_MULTIPLE,-1);

4. The entry of the query-layer in the map file:

LAYER	#wrs2
NAME "WRS-2_frame"

	PROJECTION
		proj=longlat
		ellps=WGS84
		datum=WGS84
		no_defs
	END

   DATA "wrs2/wrs2"
   STATUS OFF
   TYPE POLYGON

   TOLERANCEUNITS kilometers
   TOLERANCE 5
   DUMP TRUE

   HEADER "H:\_webroot_\mapserv_header.html"
   TEMPLATE "H:\_webroot_\mapserv_query_template.html"
   FOOTER "H:\_webroot_\mapserv_footer.html"

END # layer wrs2

4.) The map i use is a world map with these parameters:

EXTENT -180.000000 -90.000000 180.000000 90.000000
SIZE 600 300

UNITS DD

PROJECTION
	proj=longlat
	ellps=WGS84
	datum=WGS84
	no_defs
END

What i get is the common error message:

"Warning: MapServer Error in msQueryByPoint(): No matching record(s) found"

The query layer extends over the whole map.

These actions were already performed without any change to the result:

1. changed tolerance to 1 in QueryByPoint function call
2. MS_SINGLE mode tried instead of MS_MULTIPLE
3. Pixel coordinates in Point object used instead of geographic coordinates


So what the **** am i doing wrong? Unfortunately i can´t find an example 
of a template file where i could look how the results can be printed.
But i guess i need a result first and THEN there may occur errors 
concerning a misconfiguration because of a missing/wrong template file.

Do i actually need a template file if i use mapserver 3.7 with 
mapscript? Or is it only needed by the simple CGI version?

Thanks for any reply, i'm glad to know that there are some real freaks 
out there :)

(im looking forward to a documentation about how to perform queries with 
mapserver 3.7 and mapscript).

----------------------------------------------------------------------
Michael Härtel
Georg-August University Goettingen
Department of Geography
Cartography, GIS & Remote Sensing Section
project Notebook University, Internet Map Service
Goldschmidtstr. 5                           Tel.: +49 (0)551/39-12671
37077 Goettingen                            Fax : +49 (0)551/39-8020
http://www.geogr.uni-goettingen.de/kuf/




More information about the MapServer-users mailing list