[Mapserver-users] Itemquery - getting started, having problems

Richard Greenwood rich at greenwoodmap.com
Sun Apr 18 15:53:43 PDT 2004


Mike Reilly wrote:

> Hi:
> 
> I'm just starting to try to work with itemquery and itemnquery.  I've 
> read the cgi reference, the mapfile reference, trolled through the 
> archives and spent a number of hours trying to get this started.  I'm 
> obvoiusly missing something significant, however.  Here's what I'm 
> working with:
> 
> A number of shapefiles to create maps from - I have all other functions 
> working on my application - can zoom, pan, query the map, etc.  What I 
> want to do now is be able to link to the map from other pages in order 
> to display a single site - either point or polygon from one of two 
> shapfiles - tuspoints and mergeplys.  Both of these shapefiles have a 
> field (attribute?) named SITEID.  I want to be able to display these 
> point or poly sites on my map based on whether they match a specific 
> SITEID value.  After looking through the docs and archives, I figured 
> that forming a URL with mode=itemquery was what I wanted (am I going in 
> the right direction here?).  After looking at one of Richard Greenwood's 
> sites, I figured this was probably teh correct way to go.
> 
> I have not made any modifications to the shapefile I'm using in order to 
> use mode=itemnquery (am I missing something here?).  Here's an example 
> of a URL I tried to create in order to get my map displayed correctly:
> 
> http://192.168.0.3/cgi-bin/mapserv.exe?map=f:/program%20files/apache%20group/apache2/htdocs/Kitasoo/tus2-1.map&mode=itemquery&qitem=SITEID&qstring=1010&layer=landpl+streamln+lakespl+conmajl&qlayer=tuspoints 
> 
> 
> This gives me the following output:
> 
> msQueryByAttributes(): Search returned no results. No matching record(s) 
> found.
> 
> In the tuspoints layer, there is a site with a SITEID that has the value 
> 1010.  Not sure why I'm getting no matching records found.  Can anyone 
> point me in the right direction here?

Two things to try:

1. Be sure that the object having SITEID = 1010 is within the extents 
that you have defined in your map file.

2. Add 'mapext=shapes' to your query string.


-- 
Richard Greenwood
www.greenwoodmap.com



More information about the MapServer-users mailing list