Class Expression and Feature

Stephen Lime steve.lime at dnr.state.mn.us
Tue Feb 22 09:35:59 PST 2000


Hi Peter the problem looks to be in the the way you've got the expressions
set up in the Streets layer. Logical expressions only apply (for now) to shapefile
layers. The column names in brackets apply only to shapefile attribute tables.

(I like the idea of a general logical expression which i'll add in 3.3.008) 

So in this case you have to use string expressions and/or regular expressions.
Try this.

Layer 
   Name Streets
   TYPE annotation
   CLASS
     SYMBOL 0
     EXPRESSION "mark"    # matches only the string 'mark'
     ...
   END
   CLASS
     SYMBOL 4
     SIZE 20
     EXPRESSION /./          # regex that matches anything else
     ...
   END
END

Note that expressions CAN overlap. Membership is determined by the
first match encountered. So even though 'mark' matches the last class
it will always be caught by the first class.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Peter Jacobs <peter.jacobs at vs42.nl> 02/18/00 09:24AM >>>
Hello Stephen and others,

in reaction of the email I recieved from Stephen about how to put a
label on a street, I followed his advise on using the inline feature. It
doesn't seem to work tough.
Does anyone know what I did wrong

Regards,

Peter

Layer 
   Name Streets
   TYPE annotation
   CLASS
     SYMBOL 0
     EXPRESSION ('[TEXTSTRING]' ne 'mark')
     ...
   END
   CLASS
     SYMBOL 4
     SIZE 20
     EXPRESSION ('[TEXTSTRING]' eq 'mark')
     ...
   END
END

Layer 
   NAME StreetQuery
   TYPE ANNOTATION
   STAUS QUERYONLY
   QUERYITEM "TEXTSTRING"
   QUERY
     TEMPLATE
"../cgi-bin/mapserv?...&map_Streets_feature=new&map_Streets_points=[shpmidx]+[shpmidy]&map_Streets_feature_class=mark"
    END
END




More information about the MapServer-users mailing list