1

I am looking for solution to style the symbol in MapServer; with polygon outlined with simple line along with filled triangle inward like below

enter image description here

; I tried creating symbol with following way

SYMBOL
  NAME "Inward line"
  TYPE vector
  POINTS
   0   0
    5  10
    10  0
        
    
  END # POINTS
  ANCHORPOINT 0.5 0
END # SYMBOL

with line symbols adding together,. but no luck,.

2

You should close the triangle adding the start point to the end. In your sample image the triangle is filled so you should add FILLED:

SYMBOL
  NAME "Inward_line"
  TYPE vector
  FILLED true
  POINTS
    0   0
    5  10
   10   0
    0   0    
  END # POINTS
  ANCHORPOINT 0.5 0
END # SYMBOL

In the layer definition:

LAYER
  STATUS DEFAULT
  TYPE LINE
  FEATURE
    POINTS     # sample rectangle
      10 10
      90 10
      90 60
      10 60
      10 10
    END # POINTS
  END # FEATURE
  CLASS
    STYLE                 # simple line
      COLOR 0 0 0
    STYLE                 # triangles
      SYMBOL "Inward_line"
      COLOR 0 0 0
      OFFSET 15 -99       # offset perpendicular to the line
      GAP -15              # distance from center to center, negative to rotate
    END # STYLE
  END # CLASS
END # LAYER

Be careful I didn't test it!

7
  • Awesome! But didnt get the filled triangle as its a polygon to be symbolized with outline.. made the following code Layer: CLASS NAME "12" STYLE OUTLINECOLOR 0 0 0 END # STYLE STYLE # triangles SYMBOL "Inward_Triangle" OUTLINECOLOR 0 0 0 SIZE 7 OFFSET 15 -99 GAP 15 END # STYLE Aug 3 '20 at 18:09
  • 2
    @Nannan Satish, you can define type line for a polygon layer, mapserver will work with the outline of the polygons.
    – Zoltan
    Aug 3 '20 at 18:14
  • Symbol: SYMBOL NAME "Inward_Triangle" TYPE VECTOR FILLED TRUE POINTS 0 1 0.5 0 1 1 0 1 END END Aug 3 '20 at 18:14
  • Zoltan Superb,. thanks a lot,. thats done my issue.. Aug 3 '20 at 18:21
  • 1
    @Nannan Satish, multiple layers work, you cannot put TYPE into the CLASS, but you can add more styles to the same class. AFAIK if you add OUTLINECOLOR to one STYLE that will be used for outline only, add another STYLE with COLOR for fill settings.
    – Zoltan
    Aug 3 '20 at 19:22

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.