[mapserver-users] RE: Real life sample of a Mapfile for shp files on WMS

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Tue Nov 9 06:35:07 PST 2010


Actually EXPRESSIONs can handle regex too:

CLASSITEM ‘tag’
CLASS
   EXPRESSION /^TVOP2/
   …
END

This catches all tag’s that begin with the pattern TVOP2. You might want to do a FILTER instead if this is the ONLY filter you need to apply. You’d see a small performance boost if that were the case.

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of tommaso
Sent: Tuesday, November 09, 2010 5:29 AM
To: wildcolour
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] RE: Real life sample of a Mapfile for shp files on WMS

Hi, for regular expression you need to set the parameters FILTERITEM and FILTER.
>From the documentation (http://mapserver.org/mapfile/expressions.html#regular-expression-comparison<http://mapserver.org/mapfile/expressions.html#regular-expression-comparison)>)

LAYER
    NAME "regexp-example"
    FILTERITEM "placename"
    FILTER /hotel/



    ...

END

I think, the parameter EXPRESSION does not allow regular expression comparison.

Cheers,
Tommaso


On Mon, 2010-11-08 at 15:29 -0800, wildcolour wrote:



Thanks, this looks great.

I will try it tonight, but I think is looking just right.

One more related question.  The column we are using is called 'Tag'

and the seemed to have grouped the 'class' and the 'title' in the one

column.  For example all secondary roads have the tag

"TVOP2"

but roads with the name 'smith st' will look like this

"TVOP2,SMITH ST"

So my  question is in the expression can I do a 'is like' query??  I am

guessing somthing like this

EXPRESSION 'TVOP2%'



Thanks for the great support



Matt  :)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20101109/5f4deee7/attachment.htm>


More information about the MapServer-users mailing list