0

You can define a vertical line in SLD like this:

   <LineSymbolizer>
     <Stroke>
       <GraphicStroke>
         <Graphic>
           <Mark>
             <WellKnownName>shape://vertline</WellKnownName>
             <Stroke>
               <CssParameter name="stroke">#333333</CssParameter>
               <CssParameter name="stroke-width">1</CssParameter>
             </Stroke>
           </Mark>
           <Size>12</Size>
         </Graphic>
       </GraphicStroke>
     </Stroke>
   </LineSymbolizer>

There is no definition in xml for the place of that vertical line. I am making a solution for OpenLayers like in [1] but cannot figure out, how to place the vertical lines across the long line that goes horizontally.

Adding to OpenLayers goes similar to:

var format = new OpenLayers.Format.SLD();
OpenLayers.Request.GET({
    url: "yoursldfile.sld",
    success: sldparser
});
function sldparser(req) {
    sld = format.read(req.responseXML || req.responseText);
    styles = sld.namedLayers.interpreted.userStyles[0];
    building_vec.styleMap.styles.default = styles;
}

I would like to add the vertical lines to places, where the continuous line makes a tilt to new direction.

Question:

How to tell the place of vertical lines in the combo of Openlayers and sld?

More specifically:

How to tell it is in the turning point of straight line?

With picture:

enter image description here

I want the vertical "railroad hatches" to appear only in places, where the "railroad" changes direction. [2]

My source:

[1] How to use a sld file with Openlayers using OSM data?

[2] http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/lines.html#railroad-hatching

1

The vertices function might help you, as documented in the GeoServer manual. I used this to show cadastral survey points.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.