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

Mac Birch mac at mbirch.com
Thu Nov 20 10:01:23 EST 2003


Problem solved! It was in my map file EXTENTS line.

Rich, David, and others...

I got itemquery/itemnquery working with 4.0 on my Windows machines. 
The error was due to a malformed EXTENT statement in the map file. 
Yes, the Windows binaries are alive and well! Here is what I've 
learned.

1. When [mode] is set for browse or other operations, MS seems to be 
tolerant of the formation of the EXTENT parameters. I was able to 
generate perfectly good areawide coverages with a set of faulty 
extents. Using these same extents for itemquery, however, generated 
the "does not overlap" error. After succeeding with the 
Minnesota "lakespy" test data and updated map file, I knew itemqurey 
worked with 4.0.

2. To get a "good" set of extent points for an MS itemquery, set up 
a regular MS browse that return an area-wide image based on 
coordinates obtained from Arcview (or whatever). Then insert a 
[mapext] CGI tag in the template. This will yield a set 
of "corrected" extents, which you can paste into the EXTENT 
statement of the map file.

3. Formation of the qstring has no effect on the "does not overlap" 
issue. Once I solved the extents problems, it was fairly easy to 
write correct regex statements. Here were some that executed 
successfully:
('[NAME]' EQ 'Doylestown')
("[NAME]" EQ "Doylestown")
('[NAME]'EQ'Doylestown')
('[NAME]' eq 'Doylestown')
('[Name]' EQ 'Doylestown')
('[NAME]' = 'Doylestown')
('[name]' in 'Doylestown, New Hope')
([Area_id]=1)

The parser is tolerant of case-sensitivity of the database field and 
regex comparison operator, presence of spaces within the expression, 
and use of single vs. double quotes. Note, however, that field names 
containing string values *must* be in quoted square brackets.

([NAME] EQ 'Doylestown') and ('NAME' EQ 'Doylestown') failed.

Also note, that with the simple comparison operators I've used 
above,  case-sensitivity is considered for actual values of the 
fields. ('[NAME]' EQ 'DOYLESTOWN') will not find anything


So, now I'm ready to move on... without too much loss of hair. I 
hope these observations are helpful to others facing this challenge.

Thanks to all of you for pitching in.

--Mac--


--- In mapserver-users at yahoogroups.com, Richard Greenwood 
<Rich at G...> wrote:
> At 02:50 PM 11/19/2003, you wrote:
> >I'm having the same problems with the 4.0 UMN Windows binaries.  
The
> >itemquery never, ever, ever works - no matter what you do.  These 
same
> >queries worked fine on 3.6.  I, like you, have tried an incredible
> >variety of expressions, and never does MS find an item.  I'm 
extremely
> >frustrated.
> >
> >I asked the list similar questions about a month ago.  I was told 
to
> >read regex documentation, but no matter what I try the result is 
the
> >same.  I even asked the list if anyone had been able to get 
itemquery
> >working on these specific UMN 4.0 Windows binaries, but got no
> >responses.
> >
> >I am beginning to think itemqueries just do not work with the 4.0
> >Windows UMN binaries.
> 
> Sorry, I'm coming into this thread a little late, but for the 
record 
> itemquery on 4.0
> Windows UMN binaries works fine for me. Remember that the syntax 
for 
> defining your query has changed from 3.6 to 4.0. You need to 
define the 
> qitem and qstring in 4.0 (and the qlayer, same as 3.6).
> 
> The <input name="qstring" size="45"> looks suspicious to me. In 
the URI are 
> you seeing qstring=XXX, where XXX is the desired value? I would 
expect it 
> to look more like <input type=text name="qstring">
> 
> Rich
> 
> 
> >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
> 
> 
> Richard W. Greenwood, PLS
> Greenwood Mapping, Inc.
> Rich <at> GreenwoodMap <dot> com
> (307) 733-0203
> http://www.GreenwoodMap.com  
> 
> _______________________________________________
> 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