1

I have a shp file which contains some points. Each point has a "POINTTYPE" attribute which contains text.

Is it possible to apply a different symbol basing on this attribute? For example, if pointtype is "streetlamp" use a square icon, if it is "tree" use another one, etc...?

Thanks

EDIT:

Here is the final mapfile

LAYER
    NAME bla
    TYPE POINT
    GROUP bla
    DATA "bla.shp"
    STATUS OFF
    CLASS
      EXPRESSION ('[pointtype]' = 'streetlamp')
      STYLE 
        SYMBOL 'circle'
        SIZE 8
        COLOR 255 0 170
        OUTLINECOLOR 0 0 0
        ANTIALIAS TRUE
      END
    END
    # Other classes can go here, they will cumulate
END
1
  • I think the correct syntax is EXPRESSION ([pointtype] = 'streetlamp') Commented Sep 5, 2012 at 14:05

1 Answer 1

5

Read about

LAYER
CLASSITEM
CLASS
EXPRESSION

in Mapserver documentation

HTH /Nicklas

edit:

example but with polygons in the documentation:

http://mapserver.org/tutorial/example1-3-map.html#example1-3-map

What can be tricky is to get the symbols right.
Is that the problem?

9
  • I am missing just a few rep points to vote this down. If documentation was clear enough to understand this I wouldn't have asked.
    – Palantir
    Commented Mar 14, 2011 at 9:38
  • hmm, since you don't say anything about what part of the concept you don't understand I tried to point you to the parts of the map-file that handles those things. I will add a link to an example from the documentation in my answer. Commented Mar 14, 2011 at 10:14
  • Much more useful now :) I just missed the EXPRESSION parameter and how to bind it on a point's property, which turned out to be: EXPRESSION ('[pointtype]' = 'streetlamp') inside the CLASS definition. Thanks for the hint.
    – Palantir
    Commented Mar 14, 2011 at 12:12
  • Ok, didn't it work with CLASSITEM? Commented Mar 14, 2011 at 13:04
  • @Palantir - threatening to down vote someone who took the time to answer your question is not in my opinion a very good way to thank someone or build a good community here.
    – DavidF
    Commented Mar 14, 2011 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.