A better way? {Scanned}

Siki Zoltan siki at AGT.BME.HU
Mon Aug 23 01:54:15 PDT 2004


Hi Andy,

You can use regexp in expression. If you want to display only those
elements from a layer where a field = "TAP2" (exact match) then
define only one class with an expression like this

LAYER
...
CLASSITEM your_field
CLASS
...
  EXPRESSION /^TAP2$/
...
END # class
...
END # layer
...

Eelements which do not match the expression are not displayed by
mapserver.

Bye
Zoltan

On Sun, 22 Aug 2004, ANDY CANFIELD wrote:

> Currently I need to display everything from a layer where a field has "TAP2"
> in it but not "TAP2EQ".
>
> How I get around it is i have one class with no symbol in the layer which
> comes first and does this:
> "EXPRESSION /EQ/" so it gets everything with "EQ" in it which I never want
> displayed. Then my next class in the layer has a symbol and it's expression
> is:
> "EXPRESSION /TAP2/"
> This works fine but I'd rather not have to filter this way as it's relying
> on something in Mapserver which may or may not always work this way in the
> future. Is there a negation operator for within a regular expression like
> "EXPRESSION /TAP2[!EQ]/"   ?
>
> I don't know enough about regular expressions to know if there is some
> obscure negation operator. I know the standard ones but since usually you
> can do the negation outside of the expression like "if($foo !~ /EQ/){
>
> }"
> but because it's inside the map file I have no idea what to use inside a
> regex for negation of characters?
> Any ideas?
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>



More information about the MapServer-users mailing list