Rotating Symbols

Stuart Eve stuarteve at LPARCHAEOLOGY.COM
Sat May 27 10:58:21 EDT 2006


Hi Blaise

I have managed to get quite a long way down the road of extracting 
points and placing them, etc.- and I think its all going to work - 
however I have just been stumped by what seems to be to be a bug.

I have managed to set up classes for each of the points that I wish to 
draw - and now want to set their styles so that the symbol (a VECTOR) 
symbol is rotated to the angle (which I have got from my geometry 
function). However, whenever I try to access styleObj->set("angle",45) 
it says that 'angle' doesn't exist in that object. However, I can dump 
out the mapfile and it is there set as 360.

Any ideas whats going on?

Thanks

Stu

Blaise wrote:
> 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
>>>       
>
>
>
>   


-- 
Stuart Eve
L - P : Archaeology
stuarteve at lparchaeology.com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060527/09a664b0/attachment.html


More information about the mapserver-users mailing list