[mapserver-users] Querying map using CGI ...

Steve Lime Steve.Lime at dnr.state.mn.us
Mon Jun 22 17:29:09 EDT 2009


Querying is controlled via the mode parameter. Mode=query does a point query returning at most 1 result in one layer. Mode=nquery allows you
to query multiple layers and return multiple results from either a point or a rect. MapServer looks at the various additional supplied parameters to 
decide whether to do a point or rect query.

For example, this url will drop a point through all queryable layers that have status DEFAULT (since I'm not explicitly turning anything on)

  http://mapserv.org/cgi-bin/mapserv?map=foo.map&mapxy=x+y&mode=nquery

and this will do a bbox query:

  http://mapserv.org/cgi-bin/mapserv?map=foo.map&mapext=minx+miny+maxx+maxy&mode=nquery 

You can turn layers on with the layer or layers parameters and can restrict queries to one layer (if necessary) using qlayer. 

  mode=query ~ queryByPoint with MS_SINGLE
  mode=nquery ~ queryByPoint with MS_MULTIPLE or queryByRect

The qlayer parameter has the effect of running the query methods on a layerObj while without it you're running on the whole mapObj.

Does this help?

Steve

>>> On 6/22/2009 at 4:02 PM, in message
<33fad6880906221402qde8375bj252c48b367d7eb4d at mail.gmail.com>, Paul james
<pauljame at gmail.com> wrote:
> Hello guys, I pretty lost with CGI...
> Using mapscript, I can get query results with functions queryByPoint and
> queryByRect...
> How can I do that in CGI mode?
> 
> Thanks
> 
> Paul



More information about the mapserver-users mailing list