[mapserver-users] Adding symbols on top of polyline elements

Adrian Popa adrian_gh.popa at romtelecom.ro
Wed Nov 12 00:29:10 PST 2008


Hello everybody,

I managed to draw the arrows for the polyline layer, and they look ok, 
but (for a strange reason) I am required to draw these arrows both ways 
sometimes for the same element. I would like for the arrows to overlap, 
but instead only one of them is displayed. I attached 3 small pictures 
(sorry for the spam, but I hope it's not against the mailing list 
policy) with the displayed outcome in these three cases:

Case 1: displaying arrows with the 'right' symbol
 CLASS
    NAME "Right"
    EXPRESSION /^FO040314$/
    STYLE
        SYMBOL right
        SIZE 24
        COLOR 51 102 0
    END
   END
   CLASS
    NAME "Left"
    EXPRESSION /SUPERCALIFRAGILISTICEXPIALIDOCIOUS/
    STYLE
        SYMBOL left
        SIZE 24
        COLOR 102 51 0
    END
   END

Case 2:
displaying arrows with the 'left' symbol
  CLASS
    NAME "Right"
    EXPRESSION /SUPERCALIFRAGILISTICEXPIALIDOCIOUS/
    STYLE
        SYMBOL right
        SIZE 24
        COLOR 51 102 0
    END
   END
   CLASS
    NAME "Left"
    EXPRESSION /^FO040314$/
    STYLE
        SYMBOL left
        SIZE 24
        COLOR 102 51 0
    END
   END

Case 3: displaying both arrows on the same element:
  CLASS
    NAME "Right"
    EXPRESSION /^FO040314$/
    STYLE
        SYMBOL right
        SIZE 24
        COLOR 51 102 0
    END
   END
   CLASS
    NAME "Left"
    EXPRESSION /^FO040314$/
    STYLE
        SYMBOL left
        SIZE 24
        COLOR 102 51 0
    END
   END

How can I display both arrows on the same object (or do they display, 
but they overlap completely?)

Thanks for your help,
Adrian


Adrian Popa wrote:
> Can you please clarify to me what you mean by data that is oriented? 
> When I built the road layer from GPS data, I added polylines starting 
> from point A->...->B and recorded all the inflections in the road 
> between A and B.
> By ordered data you mean the direction in this case is A->B?
> If I wanted to reverse the direction I'd have to write the data to the 
> shapefile in the order B->A?
>
> Thanks
>
> thomas bonfort wrote:
>> it's the direction of the underlying geometry that's used.
>> so you either need
>> * data that's oriented, and a single boolean filed indicating if its
>> oneway or not,
>> * or an unoriented geometry, and a field indicating if the oneway
>> direction is reversed or not wrt the geometry (and two directional
>> symbols, one with > , the other with <)
>>
>> cheers,
>> thomas
>>
>> On Mon, Nov 10, 2008 at 12:01, Adrian Popa <adrian_gh.popa at romtelecom.ro> wrote:
>>   
>>> Hello Thomas,
>>>
>>> Thank you very much for your tip! It's great.
>>> However, I have a question: How can I select the direction of the arrow? I
>>> mean, between A and B I have a road segment:
>>>
>>> A----------------B
>>>
>>> Right now, it renders as A---->---->----->-----B, but I want it to render as
>>> A----<------<-----<------B.
>>>
>>> My question is: how does mapserver select the order of A and B? If I
>>> understand this, I can create another symbol and use it for the reverse
>>> path.
>>>
>>> Thanks,
>>> Adrian
>>>
>>> thomas bonfort wrote:
>>>
>>> Hi,
>>>
>>> for repeated arrow symbols, you can use a truetype (or image, or
>>> vector) symbol, with a negative GAP:
>>>
>>> SYMBOL
>>>  NAME oneway
>>>  TYPE TRUETYPE
>>>  CHARACTER '>'
>>>  FONT arial
>>>  GAP -20
>>> END
>>>
>>> and then in your layer:
>>>
>>> STYLE
>>>  SYMBOL oneway
>>>  SIZE 8
>>>  COLOR 0 0 0
>>> END
>>>
>>> cheers,
>>> thomas
>>>
>>> On Mon, Nov 10, 2008 at 10:51, Adrian Popa <adrian_gh.popa at romtelecom.ro>
>>> wrote:
>>>
>>>
>>> Hello everybody,
>>>
>>> I have a map that displays roads stored in a polyline format. I would like
>>> to mark one-way streets with an arrow symbol drawn on top of the road
>>> itself. The symbol can be as small as possible (for beginning I would like
>>> to be able to superimpose it anywhere between the street ends, and later on
>>> I will lock it to be next to one of the ends).
>>>
>>> I can already select the one way streets based on the following template:
>>>
>>>   CLASS
>>>
>>>      Name "OneWay"
>>>
>>>      EXPRESSION
>>> /^FO040127$|^FO040132$|^FO040139$|^FO040120$|^FO040104$|^FO040131$|^FO040146$|^FO040129$/
>>>      STYLE
>>>
>>>         COLOR 255 0 0
>>>
>>>         WIDTH 4
>>>
>>>      END
>>>
>>>      LABEL
>>>
>>>          COLOR 0 0 255
>>>
>>>          TYPE TRUETYPE
>>>
>>>          FONT arial
>>>
>>>          SIZE 8
>>>
>>>      ANTIALIAS TRUE
>>>
>>>
>>>          POSITION AUTO
>>>
>>>
>>>          ANGLE AUTO
>>>          PARTIALS TRUE
>>>
>>>
>>>          MINDISTANCE 0
>>>
>>>
>>>          BUFFER 0       END
>>>
>>>
>>>  END
>>>
>>> Can you show me an example of how to draw such a symbol on top of the layer?
>>> Thank you
>>>
>>> Adrian
>>>
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Adrian Popa
>>>
>>> Network Engineer
>>> Romtelecom S.A.
>>> Divizia Centrul National de Operare Retea
>>> Departament Transport IP & Metro
>>> Compartiment IP Core
>>>
>>>
>>>     
>>
>>   
>
>
> -- 
> Adrian Popa
>
> Network Engineer
> Romtelecom S.A.
> Divizia Centrul National de Operare Retea
> Departament Transport IP & Metro
> Compartiment IP Core
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>   


-- 
Adrian Popa

Network Engineer
Romtelecom S.A.
Divizia Centrul National de Operare Retea
Departament Transport IP & Metro
Compartiment IP Core


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081112/8063b22b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: case1-right.png
Type: image/png
Size: 5476 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081112/8063b22b/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: case2-left.png
Type: image/png
Size: 4954 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081112/8063b22b/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: case3-right-left.png
Type: image/png
Size: 5606 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20081112/8063b22b/attachment-0002.png>


More information about the MapServer-users mailing list