query

Paul G. Allen pgallen at randomlogic.com
Thu Oct 7 15:58:49 EDT 1999


ender at titan.lab.csuchico.edu wrote:

> To all:
>
> I have been attemping to perform a query using mapserver for some time
> now, and I have not been successful.  I have scoured over all of the
> documentation, as well as the samples, and have not been able to determine
> what I am missing.
>
> I always get the error:
> An error has occurred in msQueryUsingPoint(): Search returned no results.
>
> Could somebody tell me exactly what this error means?  Has mapserver found
> any layers to query?  How do you find out?
>
> Attached is my .map and template file
>
> [BIG SNIP]

I had the same problem you do, and I believe the reason is the same as well. I'd forgotten to put the "TOLERANCE" line in my map file (see below). The TOLERANCE keyword sets the radius in pixels
from the point of the mouse click that a query will take place. The default is 0, meaning the mouse has to be on the exact point of the object to query it. In the case of a large area - a lake,
city region, etc. -  this is OK, but in the case of a point, it usually isn't. Setting a TOLERANCE of 5 - 10 (possibly more) should do the trick. Hope this helps.

PGA

>
>
> LAYER
>   NAME sites
>   TYPE POINT
>   STATUS ON
>   DATA central_sites

#   PGA: Added TOLERANCE

    TOLERANCE 10

#===================

>
>   LABELITEM "NAME"
>   CLASSITEM "ORG_TYPE"
>   CLASS
>     SYMBOL 0
>     COLOR 255 0 0
>     EXPRESSION "F"
>     LABEL
>       POSITION ul
>       COLOR 255 0 0
>       backgroundcolor  255 255 255
>       buffer 2
>     END
>   END
>   CLASS
>     SYMBOL 0
>     COLOR 13 130 0
>     EXPRESSION "S"
>     LABEL
>       POSITION ul
>       COLOR 13 130 0
>       backgroundcolor  255 255 255
>       buffer 2
>     END
>   END
>   CLASS
>     SYMBOL 0
>     COLOR 211 29 111
>     EXPRESSION "L"
>     LABEL
>       POSITION ul
>       COLOR 128 0 128
>       backgroundcolor  255 255 255
>       buffer 2
>     END
>   END
>
>   QUERYITEM "NAME"
>   QUERY
>     EXPRESSION "^-"
>     TEMPLATE "site.html"
>   END
> END # sites layer
>
> # cities
>
> LAYER
>   NAME cities
>   TYPE POINT
>   STATUS on
>   DATA central_cities
>   TOLERANCE 10
>
>   LABELITEM "NAME"
>
>   CLASS
>     SYMBOL 0
>     SIZE 4
>     LABEL
>       COLOR  0 0 0
>       POSITION ul
>       PARTIALS off
>       backgroundcolor  200 200 200
>       buffer 5
>     END
>   END
> END # cities layer
> END # end of mapfile







More information about the mapserver-users mailing list