I've used SLD to style two type of roads with the border in GeoServer.
How can I remove the border of a road when another road or street connects to it?
As shown in the image, when roads are in the same layer they are good in conjunction (2) but, roads in different layers are drawn as (1).
This is the simplified code I'm using for styles:
<!--First layer-->
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Motorway</se:Name>
<se:Description>
<se:Title>Motorway</se:Title>
</se:Description>
<se:LineSymbolizer>
<se:Stroke>
<se:SvgParameter name="stroke">#94622F</se:SvgParameter>
<se:SvgParameter name="stroke-width">12</se:SvgParameter>
<se:SvgParameter name="stroke-linejoin">round</se:SvgParameter>
<se:SvgParameter name="stroke-linecap">round</se:SvgParameter>
</se:Stroke>
</se:LineSymbolizer>
</se:Rule>
</se:FeatureTypeStyle>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Motorway</se:Name>
<se:Description>
<se:Title>Motorway</se:Title>
</se:Description>
<se:LineSymbolizer>
<se:Stroke>
<se:SvgParameter name="stroke">#F8C967</se:SvgParameter>
<se:SvgParameter name="stroke-width">11</se:SvgParameter>
<se:SvgParameter name="stroke-linejoin">round</se:SvgParameter>
<se:SvgParameter name="stroke-linecap">round</se:SvgParameter>
</se:Stroke>
</se:LineSymbolizer>
</se:Rule>
</se:FeatureTypeStyle>
And the other style:
<!-- Second layer -->
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Link</se:Name>
<se:Description>
<se:Title>Link</se:Title>
</se:Description>
<se:LineSymbolizer>
<se:Stroke>
<se:SvgParameter name="stroke">#000000</se:SvgParameter>
<se:SvgParameter name="stroke-width">5</se:SvgParameter>
<se:SvgParameter name="stroke-linejoin">round</se:SvgParameter>
<se:SvgParameter name="stroke-linecap">round</se:SvgParameter>
</se:Stroke>
</se:LineSymbolizer>
</se:Rule>
</se:FeatureTypeStyle>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Link</se:Name>
<se:Description>
<se:Title>Link</se:Title>
</se:Description>
<se:LineSymbolizer>
<se:Stroke>
<se:SvgParameter name="stroke">#FDFCF8</se:SvgParameter>
<se:SvgParameter name="stroke-width">4</se:SvgParameter>
<se:SvgParameter name="stroke-linejoin">round</se:SvgParameter>
<se:SvgParameter name="stroke-linecap">round</se:SvgParameter>
</se:Stroke>
</se:LineSymbolizer>
</se:Rule>
</se:FeatureTypeStyle>