Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
share|improve this question
    
I think the correct syntax is EXPRESSION ([pointtype] = 'streetlamp') –  Peter Krauss Sep 5 '12 at 14:05
add comment

1 Answer 1

up vote 5 down vote accepted

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?

share|improve this answer
    
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 Mar 14 '11 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. –  Nicklas Avén Mar 14 '11 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 Mar 14 '11 at 12:12
    
Ok, didn't it work with CLASSITEM? –  Nicklas Avén Mar 14 '11 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 Mar 14 '11 at 14:46
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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