The approach is sound; what you describe is a bug; you may have to
look at how drawing an image along a line is done (from your picture
it seems to be drawn from start to finish with no special attention
paid to corners).

So your next stop should be the rendering code; you may be able to pay
attention to the rendering hints; and only engage extra logic on the
corners if specific hints are set. Given that your images are using
opactiy I recommend setting up a clipping area of the correct shape at
the end of your line; and then drawing your line "past the end" in
order to achieve the right shape.

BEFORE
=|
=+
=|

AFTER (drawn but with the clipping regions set)
    a
===/
=+/
=/
 b

Where the corners a and b for your clipping area are calculated based
on the angle between this line and the next.

(As drawn ignoring the clipping area)
===|
=+=|
===|

Hope this helps; appologies for the ascii art.
Jody
On Thu, Apr 16, 2009 at 6:01 AM, Graham Davis <[email protected]> wrote:
> This may not be the best place to ask this question, but I'm trying to do
> something with SLD in uDig which I believe uses GeoTools for SLD stuff.
>
> I'm looking at ways to display multiple routes that overlap so that each
> route is visible side-by-side.  One idea was to use SLD to style the lines
> with images that have transparent offsets in them.  For instance, line 1
> would be red and be drawn as normal, line 2 would be green and would have 2
> transparent pixels above the green part the line graphic (so that the red
> line still appeared and so the green line appeared displaced by 2 pixels).
>  I have this idea working somewhat in my examples, however, I am not
> satisfied with how the graphicstroke draws graphics along a line.  There are
> gaps/spaces at every vertex. I've tried searching for various cssparameters
> and other rules to prevent this, but nothing seems to work.  No matter what
> I do, there are always gaps.  Here is an example linesymbolizer from my SLD.
>  I have 2-3 of these setup with different graphics for the lines:
>
>                   <sld:LineSymbolizer>
>                       <sld:Stroke>
>                           <sld:GraphicStroke>
>                               <sld:Graphic>
>                                   <sld:ExternalGraphic>
>                                       <sld:OnlineResource
> xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:type="simple"
> xlink:href="file:/C:/Graham/purp_4.gif"/>
>                                       <sld:Format>image/gif</sld:Format>
>                                   </sld:ExternalGraphic>
>                                   <sld:Opacity>
>                                       <ogc:Literal>1.0</ogc:Literal>
>                                   </sld:Opacity>
>                                   <sld:Size>
>                                       <ogc:Literal>8</ogc:Literal>
>                                   </sld:Size>
>                                   <sld:Rotation>
>                                       <ogc:Literal>0.0</ogc:Literal>
>                                   </sld:Rotation>
>                               </sld:Graphic>
>                           </sld:GraphicStroke>
>                       </sld:Stroke>
>                   </sld:LineSymbolizer>
>
> Attached is a screenshot of how this looks.  The green line is actually just
> a normal stroke (and it has no gaps).  The black and the purple lines are
> styled with GraphicStrokes as shown above.  They both have gaps.  Are there
> any additional parameters I could use to prevent these gaps?  Or maybe some
> tricks/hacks to get around this?  Also, I notice various email threads and
> forum postings about maybe having a displacement/offset attribute added for
> lines.  Is this already part of the 1.1.0 SLD spec, or something new?  Does
> GeoTools implement 1.0.0 or 1.1.0 of the SLD spec?
>
> --
> Graham Davis
> Refractions Research Inc.
> [email protected]
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to