1

I need to specify a rectangle symbol in a mapfile. The symbols should be of varying dimensions based on height/width values stored in a table's attributes. Is it possible to do something as with the ANGLE parameter (I imagined the parameters names HEIGHT and LENGTH for the example):

    CLASS
      NAME "myLayerName"
      STYLE
        SYMBOL "rectangle"
        HEIGHT [attr_height]
        LENGTH [attr_width]
        ANGLE [attr_orientation]
      END
    END
1

That is only partly supported. By the documentation of MapServer 7.0.1 http://mapserver.org/mapfile/style.html#style your HEIGHT is supported with a keyword "SIZE". Angle is supported as "ANGLE". But your LENGTH (width) is not supported. Instead the width of the symbol is scaled by the same factor as SIZE. Here are my test mapfile and the rendered result.

SYMBOL
    NAME 'SQUARE'
    TYPE vector
    FILLED true
 POINTS
    0 0
    0 1
    1 1
    1 0
    0 0
 END
 END

LAYER
 name "pointshp"
 type POINT
 status ON
 DATA "some_points_with_attributes.shp"

 CLASS
       NAME "myLayerName"
       STYLE
         SYMBOL "SQUARE_TL"
          COLOR 255 0 0
         SIZE [height]
         ANGLE [angle]
       END #style
    END #class
END #layer

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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