3.10.4. LinePatternSymbolizer
A LinePatternSymbolizer draws a given pattern image along a line, repeating the pattern as often as needed, and transforming it accordingly to follow the turns of the line.
Warning
|
Even when giving the pattern as a SVG file, internally it will be converted to PNG before applying transformations to it to make it fit the line. So when creating SVG or PDF output, the result can still become a bit blurry when zooming in on LinePatternSymbolizer output. |
Attribute | Value | Default | Description |
---|---|---|---|
file path |
none |
Path to pattern file |
|
|
string |
none |
name of a <FileSource> to find the input file in |
|
|||
|
|||
|
|||
Example 38. LinePatternSymbolizer file
<?xml version="1.0" encoding="utf-8"?>
<Map background-color='white'>
<FileSource name="symbols">./symbols</FileSource>
<Style name="style">
<Rule>
<LinePatternSymbolizer base="symbols" file="[file]"/>
<TextSymbolizer face-name="DejaVu Sans Book" allow-overlap="true" dx="-50">[file]</TextSymbolizer>
</Rule>
</Style>
<Layer name="layer">
<StyleName>style</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
wkt,file
"LINESTRING(10 50,50 60,90 50)",cliff.svg
"LINESTRING(10 30,50 40,90 30)",line-with-dot.svg
"LINESTRING(10 10,50 20,90 10)",steps.svg
</Parameter>
</Datasource>
</Layer>
</Map>
Example 39. LinePatternSymbolizer base
<?xml version="1.0" encoding="utf-8"?>
<Map background-color='white'>
<FileSource name="symbols">./symbols</FileSource>
<FileSource name="red">./symbols/red</FileSource>
<FileSource name="green">./symbols/green</FileSource>
<FileSource name="blue">./symbols/blue</FileSource>
<Style name="style">
<Rule>
<LinePatternSymbolizer base="red" file='steps.svg'/> <!-- TODO does not evaluate [base] yet -->
<PointSymbolizer base="symbols" file='steps.svg' transform='translate(0,5)'/>
<TextSymbolizer face-name="DejaVu Sans Book" allow-overlap="true" dy="20">[base]</TextSymbolizer>
</Rule>
</Style>
<Layer name="layer">
<StyleName>style</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
wkt,base
"LINESTRING(10 10,50 20,90 10)",red
"LINESTRING(10 20,50 30,90 20)",green
"LINESTRING(10 30,50 40,90 30)",blue
</Parameter>
</Datasource>
</Layer>
</Map>