[Mapserver-users] Re: itemquery problem -- I'm pulling my hair out.

Mac Birch mac at mbirch.com
Wed Nov 19 17:16:34 EST 2003


David,

I found the page you're referring to several days ago in an earlier 
run at this problem, but to no avail then. (Are you using a Windows 
server?) Still, I took another shot at it. Here's what I did:

1) I removed the qitem reference from the submitted form. It's 
optional anyway.

2) I switched around the minY and maxY values in the EXTENT 
reference of the map file. Another email responder (thanks, Adam 
from Albany OR) suggested that these were in the wrong order. This 
didn't fix the query, but I've changed it anyway.

3) I submitted the form with the following values, using the syntax 
specified in your referenced page. Note that I switched fields to 
avoid any possible conflict with MS reserved words (ie, "NAME").

('[AREA_ID]' IN 4,5,6)   #(AREA_ID is a dbase integer field)
('[AREA_ID]' IN '4,5,6') # let's try strings anyway
('[AREA_ID]' IN 4)	 # maybe it only works with one value	
('[AREA_ID]' IN '4')	 # maybe using a string will do the trick
('[AREA_ID]'+IN+4,5,6)   # repeat using plusses-- just in case it's
('[AREA_ID]'+IN+'4,5,6') #   a browser/querystring issue
('[AREA_ID]'+IN+4)
('[AREA_ID]'+IN+'4')

4) After trying the above, I reinserted the qitem parameter and 
repeated #3 above.

5. No go on any of these attempts. I've worked with MS for three 
years, and I've never hit the wall like this before. Have other 
Windows users experienced this problem?

Note: I have noticed, however, that MS is totally unresponsive to 
any MAPEXT values I'm submitting from the form. I've 
tried "SHAPE", "SHAPES", "shape", "shapes", the actual extents of 
the desired polygon, basic gibberish, and null. I've also tried 
removing the parameter entirely. In all cases MS continued to return 
the "Search returned no results. No matching record(s) found, layer 
and area of interest do not overlap." message. This seems to be an 
extent issue.

Thanks for pitching in.

--Mac--


-----Original Message-----
From: David Fawcett [mailto:David.Fawcett at state.mn.us] 
Sent: Wednesday, November 19, 2003 3:28 PM
To: mac at mbirch.com
Subject: [Mapserver-users] Re: itemquery problem -- I'm pulling my 
hairout.

Mac, 

Take a look at what worked for me.  

http://mapserver.gis.umn.edu/data2/wilma/mapserver-
users/0308/msg00130.html


David.

David J. Fawcett
MN Office of Environmental Assistance


--- In mapserver-users at yahoogroups.com, "David Fawcett" 
<David.Fawcett at s...> wrote:
> Mac, 
> 
> This is really low hanging fruit, and your problem may lie much 
higher
> in the tree....but, try stating your qitem in all uppercase e.g.
> [NAME].
> 
> I have found this to be necessary for all shapefile based 
queries.  
> 
> David.
> 
> David J. Fawcett
> MN Office of Environmental Assistance
> 
> >>> "Mac Birch" <mac at m...> 11/19/2003 12:51:39 PM >>>
> Has anyone had any success using itemquery with MS 4.0 with IIS on 
> XP-Professional? 
> 
> My map file extents have been carefully defined to include a box 
> that is much, much larger than the theme coverage I'm searching.
> 
> All other aspects of the system work, but I still am getting the 
> dreaded "Search returned no results. No matching record(s) found, 
> layer and area of interest do not overlap." message.
> 
> Here's the .map file I'm using:
> 
> #
> # Start of map file
> #
> NAME TESTQuery
> STATUS ON
> SIZE 480 520
> EXTENT 1300000 1443024 4126986 -682424
> SHAPEPATH "c:\myApplicationPath\buckscounty\GIS\data"
> 
> OUTPUTFORMAT
>   NAME png
>   DRIVER "GD/PNG"
>   MIMETYPE "image/png"
>   IMAGEMODE RGBA
>   EXTENSION "png"
> END
> 
> #
> # Start of web interface definition
> #
> 	
> WEB
>   #EMPTY ../../buckscounty/gis/RecNotFound.htm
>   TEMPLATE queryResult.htm
>   IMAGEPATH "e:\myimagepath\buckscounty\tmp\"
>   # LOG "testQuery.log"
> END
> 
> QUERYMAP
>   STATUS ON
>   STYLE HILITE
>   COLOR 255 255 0
> END
> 
> LAYER
>   NAME boundaries
>   DATA townBoundaries
>   STATUS DEFAULT
>   TYPE  polygon
>   TEMPLATE queryResult.htm 
>   CLASS
>     COLOR 212 212 212
>     OUTLINECOLOR 0 0 0
>   END
> END
> 
> END # Map File
> 
> Here's the essence of the form I'm submitting:
> 
> <form action="http://www.mydomain.com/gis/mapserver40-
> png/mapserv.exe" method="get">
> <input type="hidden" name="map" 
> value="../../mapPath/buckscounty/gis/testQuery.map">
> <input type="hidden" name="mode" value="itemquery">
> <input type="hidden" name="savequery" value="true">
> <input type="hidden" name="qlayer" value="boundaries">
> <input type="hidden" name="qitem" value="Name">
> <input type="hidden" name="mapext" value="shapes">
> <input type="submit" value="Submit Query">
> <input name="qstring" size="45">
> </form>
> 
> I have tried submitting just about every possible combination of 
> qstring options I can think of. for example,
> 
> ([Name] EQ 'Doylestown')
> ([Name] EQ "Doylestown")
> ('[Name]' IN 'Doylestown')
> ([Name] = 'Doylestown')
> ([Name] = "Doylestown")
> ('[Name]' EQ "Doylestown")
> ('[Name]' EQ 'Doylestown')
> ('[Name]' EQ Doylestown)  -- Yikes!!
> 
> etc. (I think you get the picture)
> 
> Upper/lower cases of the "Name" variable and "Doylestown" are 
> identical to those that appear in the shapefile.dbf table
> 
> It appears that MS is simply not finding the requested variable in 
> the qstring, so I even tried submitting strings that would always 
> evaluate to TRUE, such as
> 
> (1 EQ 1)
> (1 = 1)
> (2 GE 1)
> (2 <= 1)
> ([Name] EQ [Name]  etc.
> 
> Still, the same result.
> 
> Where have I gone wrong? Please share your success stories.
> 
> Much Appreciated
> 
> --Mac--
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at l... 
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at l...
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list