itemnquery (qstring) search specifications -- "=" vs like {Scanned} {Scanned}

Siki Zoltan siki at AGT.BME.HU
Thu Dec 9 20:18:09 EST 2004


Hi,

It's regexp, try /^A$/

Bye
Zoltan

On Thu, 9 Dec 2004, Geographic Resource Solutions 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
>
> At 12:02 PM 12/9/2004 -0700, you wrote:
> >On Thu, 9 Dec 2004 08:34:26 -0800, Geographic Resource Solutions
> ><grs at grsgis.com> wrote:
> >>  Dear list-
> >>
> >>  I have searched the list for something like this and  have come up
> empty.
> >>
> >>  After getting everything to work I find my queries are not returning
> the
> >> features I desire.  Rather they are returning too many 'hits.'  The
> search
> >> expression is obviously operating as an SQL 'like'  with wildcards at
> each
> >> end of the specified value rather than an SQL '='.  For example,
> >>
> >>  qstring = |101011|
> >>
> >>  when applied to my parcel data returns all parcels that have the
> 101011
> >> characters present in their value, no matter where they are in the
> string.
> >> Thus I get parcels 12 parcels starting with 101011,  but I also get
> parcels
> >> like 522101011' which I do not want.
> >>
> >>  Similarly, when searching for a land use code of 'A'  I return all
> the 'A'
> >> land use polygons, but I also get all the 'AC-WR'  and any others that
> have
> >> an 'A' in them which I do not want located.
> >>
> >>  So my question is:
> >>
> >>  Am I doing somethin wrong ?  How do I specify an expression that
> should be
> >> an equality '=' rather than a 'like' ?  Is there a wildcard that can
> be
> >> included in the expression statement so that it operates as I define
> it
> >> (e.g. (101011% or A%)) rather than assuming wildcards are part of the
> >> expression at beginning and end.  This is obviously not following
> standard
> >> SQL formatting so what are the definitions that apply to expressions
> and how
> >> can I generate the query results I need.  Queries that return improper
> >> results make the programmer look rather foolish - and of course I
> would like
> >> to avaoid that appearance !  I figure there must be a way - and if
> not, then
> >> there really needs to be a way - but what is it ?
> >>
> >>  Thanks in advance,
> >>
> >>  Ken Stumpf
> >>
> >>
> >>
> >> Geographic Resource Solutions
> >> 1125 16th Street, Suite 213
> >> Arcata, CA 95521
> >> Phone: (707) 822-8005
> >> Fax: (707) 822-2864
> >>  www.grsgis.com
> >
> >
> >Mapserver uses regular expression syntax, not SQL syntax, on the
> >qstring. Try leaving off the pipe characters for starters, the apply
> >regex symbols.
> >
> >Regards,
> >--
> >Richard Greenwood
> >richard.greenwood at gmail.com
> >www.greenwoodmap.com
> >
> Geographic Resource Solutions
> 1125 16th Street, Suite 213
> Arcata, CA 95521
> Phone: (707) 822-8005
> Fax: (707) 822-2864
>
> www.grsgis.com
>



More information about the mapserver-users mailing list