Rendering a tiny image over a line / dashed-line

View: New views
3 Messages — Rating Filter:   Alert me  

Rendering a tiny image over a line / dashed-line

by Manoj Bist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

1. ) Is there a way to draw a small image over  a dashed line? I tried using the ShieldSymbolizer with the LineSymbolizer. In the ShieldSymbolizer, I specified size as "0" to indicate that I do not want to write a text on the image.

Following is textual representation of what I am trying to render. It is okay to draw the image and the name anywhere on the line.

====<image> ============ My line name here ===================


            <LineSymbolizer>
                <CssParameter name="stroke">rgb(255,0,0)</CssParameter>
                <CssParameter name="stroke-width">2.5</CssParameter>
                <CssParameter name="stroke-dasharray">4,2</CssParameter>
            </LineSymbolizer>
             <ShieldSymbolizer name="NAME" face_name="DejaVu Sans Bold" size="0" fill="#ff0000" min_distance="50" file="path to my png file" type="png" width="15" height="15" spacing="100" allow_overlap="false"></ShieldSymbolizer>
            <TextSymbolizer name="NAME" face_name="DejaVu Sans Bold" size="8" fill="rgb(204,204,204)" placement="line" allow_overlap="true"></TextSymbolizer>

2) Is there a way to draw a line with double dashes (=====) without  using the LinePatternSymbolizer?

Thanks,

-- MB.
Tired of reading blogs? Listen to  your favorite blogs at http://www.blogbard.com   !!!!


_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Rendering a tiny image over a line / dashed-line

by Nicolas Gillet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Manoj,

About the shield I am not sure if size = 0 will work I'd better try to set "name" attribute to a field containing always a short text (smaller than you shield width), setting size to 6 and color as the same color than the image shield you are willing to use. (e.g. green text on green image will be invisible).
At least as a test you will see if there is a behavior close to what you want.

About double dashed lines it is possible and not.
If you want to have only two dashes and the rest of the line fully transparent it is not unless using pattern.
But if you want e.g a red line with inside a double dashed yellow line, that is possible
- draw first a thick solid red line of e.g. 9.0 width
- draw a dashed yellow line a bit smaller of e.g. 5.0 width
- finally, draw a thin red line of e.g. 3.0 width

Regards,

Nicolas

Manoj Bist wrote:
Hi,

1. ) Is there a way to draw a small image over  a dashed line? I tried using
the ShieldSymbolizer with the LineSymbolizer. In the ShieldSymbolizer, I
specified size as "0" to indicate that I do not want to write a text on the
image.

Following is textual representation of what I am trying to render. It is
okay to draw the image and the name anywhere on the line.

====<image> ============ My line name here ===================


            <LineSymbolizer>
                <CssParameter name="stroke">rgb(255,0,0)</CssParameter>
                <CssParameter name="stroke-width">2.5</CssParameter>
                <CssParameter name="stroke-dasharray">4,2</CssParameter>
            </LineSymbolizer>
             <ShieldSymbolizer name="NAME" face_name="DejaVu Sans Bold"
size="0" fill="#ff0000" min_distance="50" file="path to my png file"
type="png" width="15" height="15" spacing="100"
allow_overlap="false"></ShieldSymbolizer>
            <TextSymbolizer name="NAME" face_name="DejaVu Sans Bold"
size="8" fill="rgb(204,204,204)" placement="line"
allow_overlap="true"></TextSymbolizer>

2) Is there a way to draw a line with double dashes (=====) without  using
the LinePatternSymbolizer?

Thanks,

-- MB.
Tired of reading blogs? Listen to  your favorite blogs at
http://www.blogbard.com   !!!!

_______________________________________________
Mapnik-users mailing list
Mapnik-users@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Rendering a tiny image over a line / dashed-line

by Dane Springmeyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 18, 2009, at 12:25 AM, Manoj Bist wrote:

> 2) Is there a way to draw a line with double dashes (=====) without  
> using the LinePatternSymbolizer?

Yes, check out the patch attached to: http://trac.mapnik.org/ticket/180

Dane
_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users