[mapserver-users] How do you display a symbol with two colours?

geographika geographika at gmail.com
Tue Oct 9 13:32:21 PDT 2012


Hi,

I'm trying to draw a point layer, with each point represented in two 
colours (for example a square split in two with one half red and one 
half green).
I can create the symbols and apply the data but either the squares are 
the incorrect shape, or they overlap. The closest I got was with the 
following CLASS definition, but then it appeared the colours were shown 
on the wrong side of the square.
Images and further details at 
http://gis.stackexchange.com/questions/35283/mapserver-symbol-with-two-colours
Symbol definitions:

|SYMBOL
     NAME 'SQUARE_L'
     TYPE vector
     FILLED true
     POINTS
         0 0
         0 1
         0.5 1
         0.5 0
         0 0
     END
END
SYMBOL
     NAME 'SQUARE_R'
     TYPE vector
     FILLED true
     POINTS
         0.5 0
         1 0
         1 1
         0.5 1
         0.5 0
     END
END

# CLASS definition


	

I'd like to symbolise a point dataset with a square (or circle) using two colours. This is useful for displaying values collected on both sides of a road (for example).

split symbols

I created two symbols, a left side and right side of the square as shown below:

SYMBOL
     NAME 'SQUARE_L'
     TYPE vector
     FILLED true
     POINTS
         0 0
         0 1
         0.5 1
         0.5 0
         0 0
     END
END
SYMBOL
     NAME 'SQUARE_R'
     TYPE vector
     FILLED true
     POINTS
         0.5 0
         1 0
         1 1
         0.5 1
         0.5 0
     END
END

Then in my LAYER I can create a CLASS using the two different STYLES:

CLASS
     STYLE
         SYMBOL "SQUARE_L"
         COLOR [LEFT_CLR]
         SIZE 10
     END
     STYLE
         SYMBOL "SQUARE_R"
         COLOR [RIGHT_CLR]
         SIZE 10
     END
  END


|

Any help appreciated,

Seth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121009/570908ec/attachment.html>


More information about the mapserver-users mailing list