0

I can't seem to get past this hurdle. Mapserver isn't throwing any errors...but it isn't returning anything either...I suspect my logical expression (... in the absence of any errors...I really have little clue what is going down here).

Ideally, I'd like to filter by my shapefile using these two columns: '[YODA] (text)' AND '[ZOOM] (Integer)'.

Currently my code reads as:

    LAYER
        # Zoom Level 11-16
        TYPE ANNOTATION
        STATUS ON 
        GROUP "yoda"
        DATA "yoda_graphics"
        NAME "yoda_awesome"
    #    # Visible in map from zoom level 11 onwards
        MAXSCALEDENOM 325008
        MINSCALEDENOM 5078
        LABELITEM "label"
        CLASS
        # Yoda Head
        EXPRESSION (('[YODA]' ~* '/^I/') AND ([Zoom]>8)) ## where things are suspect...
        # yoda shell symbol w/ label
        STYLE
          SYMBOL 'yoda_red_top_shell'
          #COLOR  255 255 255
          #COLOR 218 218 203
          COLOR 184 184 156
          SIZE 16
        END
        STYLE
          SYMBOL 'yoda_red_top_shell'
          #COLOR 225 104 104
          #COLOR 204 184 181
          COLOR 214 214 169
          SIZE 15
        END
        STYLE
         SYMBOL 'yoda_blue_shell'
         #COLOR  80 101 123
         #COLOR 183 192 221
         COLOR 241 241 226
         SIZE 15
        END
        LABEL
          TYPE truetype
          FONT "deja-bold"
          SIZE 5
          #COLOR 255 255 255
          COLOR 184 184 156
          PARTIALS FALSE
          WRAP " "
          ALIGN center
          POSITION CC
          ANGLE 0
        END # end label
      END #end class  
END # layer
user14696
  • 657
  • 2
  • 10
  • 30
  • 1
    Does your shapefile effectively have a "Zoom" attribute? If you want to do scale-dependant rendering you should be using minscale/maxscale, there is no such thing as a predefined "zoom" attribute in mapserver. – Thomas Bonfort Dec 03 '13 at 11:59
  • Also you should probably watch your use of character case because shapefile attributes should always be UPPERCASE and postgis attributes should be lowercase. That said, the issue Thomas pointed out is probably your real problem here. – Stephen Woodbridge Dec 03 '13 at 18:01
  • @ Stephan/Thomas...Actually there is a "Zoom" attribute in my shapefile (it is not a postgres db)....I played with the field name, no change. It is the regular exp...(“String1” ~* “regexp”) part...but I can't figure what and why there (I've tried it with both the single and double quotes).... – user14696 Dec 03 '13 at 18:41

1 Answers1

0

You shouldn't surround your regular expression with slashes when using an explicit regular expression operator.

This is correct:

CLASSITEM "Yoda"
CLASS
  EXPRESSION /^I/

In your case, use:

EXPRESSION (('[YODA]' ~* '^I') AND ([Zoom]>8))
Thomas Bonfort
  • 321
  • 1
  • 8