[mapserver-users] vertical alignment of symbols along a line
Brent Fraser
bfraser at geoanalytic.com
Tue Feb 23 08:01:21 PST 2010
If your symbol is relatively simple, you could use a vector symbol. Below is a
method of rendering a line with "hachures" (short lines on one side of the main
line):
In your layer def:
CLASS
NAME 'hachure'
STYLE
COLOR 180 180 180
WIDTH 1
END
STYLE
COLOR 180 180 180
SIZE 16
SYMBOL 'hachure'
END
With a symbol def:
Symbol
NAME 'hachure'
TYPE VECTOR
POINTS 5 5 5 10 END
PATTERN 6 6 END
FILLED TRUE
END
To draw a triangle instead of a line, the POINTS object would have to include a
third vertex (four if you want it filled?); something like:
POINTS 5 5 10 10 15 5 5 5 END
But you'd have to experiment. The key (I think) to offsetting the symbol is
that the symbol's vectors are drawn in the top half of the symbol box, in this
case the symbol box is 0 to 10 with vectors only in the 5 to 10 range.
Best Regards,
Brent Fraser
windfreak wrote:
> I use truetype fonts to render symbols along a line. The fonts are always
> parallel to the line. Unfortunately I see the fonts are always centered
> vertically along the line. Even symbols like the '^' or '`' symbol appear on
> the line. How can I disable this vertical alignment?
> Here you see an example of a triangle symbol that should appear above the
> line. http://n2.nabble.com/file/n4617860/example.png
> Here you see an example of the '^' symbol, also aligned on the line.
> http://n2.nabble.com/file/n4617860/example2.png
>
>
> -----
> http://www.topspots.org
More information about the MapServer-users
mailing list