I have a line layer in geoserver as in the 1st image.
How can I draw an arrow on the line like in the 2nd image?
The line.rar includes a shapefile and a sld file.
Can edit a sample for me?
Answer
The GeoServer documentations states how to extract start and end points with geometry transformations (just use the end- point rule). The code example provided uses square
as marks, but you could always replace this with e.g. the shape symbol shape://oarrow
.
EDIT: I forgot to mention how to rotate the triangle correctly (couldn't find it in the documentation, but took it from page 38 in this presentation)!
the_geom
EDIT2: Just wanted to make sure everything works as described, here is a code sample based on GeoServer's default blue line SLD style:
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Blue arrows
A blue line with end arrows
Blue_Arrow_Line
#0000FF
2
the_geom
shape://oarrow
#0000FF
0.5
#0000FF
2
30
the_geom
![]()
This is how it should look like:
No comments:
Post a Comment