Rotating Symbols

Blaise bpicinbono at WORLDONLINE.FR
Fri May 26 12:14:47 EDT 2006


Stu
I don't know what output you want exactly, but yes, using mapscript, you can 
easily put an arrow on each segment of a polyline with a loop something 
like :
for each polyline
 for each segment of polyline
  get start and stop point of segment
  calculate middle point of segment and angle
  create new annotation arrow

The geometry calculation is pretty straight forward, it's basic 2d geometry.
Ask more if you need help on the mapscript functions and/or the geometry 
calculation.
But maybe someone else on this list has got a better/different idea.
Regards
Blaise

Le Vendredi 26 Mai 2006 16:41, vous avez écrit :
> Blaise
>
> Thanks for the reply. I presume that we could automatically create a
> bunch of points along the line using mapscript or something - but then
> how would we make sure that it was always at right angles to the line? I
> guess we would have to do some fancy geometry to figure out what angle
> that section of line was... sounds hard!
>
> Mind you it may be the only way - thanks for your help!
>
> Stu
>
> Blaise wrote:
> > Le Vendredi 26 Mai 2006 16:23, Stuart Eve a écrit :
> >> Dear All,
> >>
> >> We have been trying to get symbols to rotate along a line in mapserver
> >> (4.8.3). Basically we want to get a small triangle pointing either 45
> >> degrees or 270 degrees to a line.
> >>
> >> We firstly tried using PIXMAPs - but I don;t think its possible to
> >> rotate these at all (is that true?) plus they do not seem to follow the
> >> line and always just point 'up'.
> >>
> >> So we then tried using some truetype symbols - these follow the line -
> >> but seem to be rather erratic as to which way they point. We are using a
> >> small triangle from the webdings.ttf set - and sometimes it will point
> >> up and sometimes it will point down (but even if its on the same section
> >> of the line).
> >>
> >> Does anyone have any pointers?
> >>
> >> Thanks in advance
> >>
> >> Stu
> >
> > Hi Stu
> > Well, not sure about that, but sometimes it's hard to have the symbols
> > exactly where you want. Perhaps you could create a special layer (point
> > or annotation) to deal with your triangles. It should then be easier to
> > manipulate. Of course it's extra data, extra code, extra mapfile parsing
> > and so on but you'll have your symbols where you want and well rotated.
> > Regards
> > Blaise



More information about the mapserver-users mailing list