itemnquery (qstring) search specifications -- "=" vs like

Steve Lime steve.lime at DNR.STATE.MN.US
Fri Dec 10 13:00:20 PST 2004


Actually qstring=A will match all values in qitem that contain exactly
'A'. The default expression handler is just a straight case-sensitive
string match. Also remember that whatever EXTENT is set in your mapfile
(or via the CGI or MapScript) is used to filter shapes before checking
their attributes. It's possible then that setting qstring=A will fail if
potential matches fall outside that area of interest.

Steve

>>> Richard Greenwood <richard.greenwood at GMAIL.COM> 12/9/2004 6:32:35
PM >>>
On Thu, 9 Dec 2004 12:40:00 -0800, Geographic Resource Solutions
<grs at grsgis.com> wrote:
>  Richard-
>
>  Thanks for the reply-
>
>  Sorry for my confusion - I typed a "|"  when it should have been a
"/"  I
> appear to have the syntax correct for making a match.
>
>  If I seach for qstring=/A/  I get every land use type with that as
part of
> the use designation
>  including the  'AC-RW' - I don't want the 'AC-RW' match as it is not
of
> type 'A'
>
>  If I leave it as A,  /A,  or A/  I get "no records found" - How do I
get a
> match for only the polygons of type 'A' and none of the others with
an A in
> the type ?
>
>  I need to be able to specify an absolute equality/match for
character
> fields as opposed to a match based on a portion of any character
value in
> that field.  Are there other characters to include in the qstring
that
> specify what type of match to perform ?
>
>  Ken

1. Try putting it quotes, single or double.

2. Where are you putting this qstring=A? Typically a "qstring=x" is
specified in the URL and passed to mapserver. And then your map file
would have a FILTER and FILTERITEM for that layer.

3. Remeber that you're working with regex expressions, not SQL
statements.

Regards,
--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the MapServer-users mailing list