[mapserver-users] queryByAttribute Expression Matching

Steven Lehr lehrs at erau.edu
Wed Jun 4 18:58:33 EDT 2008


Ian:

Here's a sample from a text attribute in a shape file, so if you have
multiple schools, then just add multiple classes.

 LAYER
    NAME "soils"
    DATA soils
    STATUS OFF
    TYPE polygon
    MAXSCALE 50000
    LABELITEM "MUSYM"
    CLASS
      EXPRESSION('[MUSYM]' eq 'AkA')
      STYLE
        COLOR 166 206 227
      END
      LABEL
        TYPE TRUETYPE
        FONT arial
        SIZE 10
        COLOR 0 0 0
        POSITION CC
      END
    END 

Steve
 
-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Steve Lime
Sent: Wednesday, June 04, 2008 6:10 PM
To: mapserver-users at lists.osgeo.org; Ian Tidy
Subject: Re: [mapserver-users] queryByAttribute Expression Matching

Hi Ian: A straight regex should work. That is, your query string should
be something like /BOYS/ assuming you're using shapefiles.

Steve

>>> On 6/3/2008 at 9:03 PM, in message
<E61EFB2FD2D8E34C9217954D795BC902E0C67C at owa.napier.govt.nz>, "Ian Tidy"
<IANT at napier.govt.nz> wrote:
> Hi All,
> 
> I am struggling to get my expression match to work properly.
> 
> I need to match a string with any part of the attribute value.  So if 
> in may SRCH field I have 'NAPIER BOYS HIGH SCHOOL', if I search for 
> BOYS or SCHOOL (any combination of letters / part of the word that 
> matches), I will get this object.
> 
> Can anyone help.
> Cheers Ian
> ______________________
> Ian Tidy
> GIS Analyst / Developer
> Works Asset Department
> Napier City Council
> Hastings St, Private Bag 6010, Napier, New Zealand Phone 
> +64-6-835-7579 Ext. 8115 Fax +64-6-834-4195 mailto:iant at napier.govt.nz

> http://www.napier.govt.nz | http://maps.napier.govt.nz
> 
> 
> 
> 
> ######################################################################
> ######
> #########
> This e-mail message has been scanned for Viruses and Content and 
> cleared by MailMarshal 
> ######################################################################
> ######
> #########
> 
> ######################################################################
> Attention: 
> This e-mail message and accompanying data may contain information that

> is confidential and subject to legal privilege. Any information 
> provided is given in good faith. However unless specifically stated to

> the contrary, Napier City Council accepts no liability for the content

> of this e-mail or for the consequences of any action taken on the 
> basis of the information provided, unless that information is 
> subsequently confirmed in writing. If you are not the intended 
> recipient, you are notified that any use, dissemination, distribution 
> or copying of this message or data is prohibited. If you received this

> e-mail message in error, please notify us immediately and erase all 
> copies of this message and attachments. Thank you.

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list