A Symbolizer for linear geometries that consists of a color and a width.
You can create a Stroke with a color and width:
def shape = new Shape("#ff0000", 0.25)
Or with named parameters:
def stroke = new Stroke(width: 1.2, dash: [5,2], color: "#ff00ff", opacity: 0.75)
| Type | Name and description |
|---|---|
Expression |
capThe line cap (butt, round, square) |
Expression |
colorThe color in hexadecimal format (#00FF00) |
java.util.List |
dashThe dash pattern. |
Hatch |
hatchThe Hatch |
Expression |
joinThe line join (miter, round, bevel) |
Expression |
opacityThe opacity (0: transparent - 1 opaque) |
Expression |
perpendicularOffsetThe perpendicular offset |
Shape |
shapeThe Shape for spaced graphics |
Expression |
widthThe width (1, 2, 5, ect...) |
| Constructor and description |
|---|
Stroke
(java.lang.Object color = "#000000", java.lang.Object width = 1, java.util.List dash = null, java.lang.Object cap = null, java.lang.Object join = null, java.lang.Object opacity = 1.0)Create a new Stroke. |
Stroke
(java.util.Map map)Create a new Stroke with named parameters. |
| Type | Name and description |
|---|---|
protected void |
apply(org.geotools.styling.Symbolizer sym)Apply this Symbolizer to the GeoTools Symbolizer |
protected org.geotools.styling.Stroke |
createStroke()Create a GeoTools Stroke from this GeoScript Stroke |
Stroke |
hatch(java.lang.Object name, Stroke stroke = new Stroke(, java.lang.Object size = 8)Add a Hatch pattern to this Stroke |
Stroke |
perpendicularOffset(java.lang.Object offset)Set the perpendicular offset |
protected void |
prepare(org.geotools.styling.Rule rule)Prepare the GeoTools Rule by applying this Symbolizer |
void |
setCap(java.lang.Object cap)Set the line cap(butt, round, square) |
void |
setColor(java.lang.Object color)Set the color |
void |
setJoin(java.lang.Object join)Set the line join(miter, round, bevel) |
void |
setOpacity(java.lang.Object opacity)Set the opacity (0: transparent - 1 opaque) |
void |
setPerpendicularOffset(java.lang.Object offset)Set the perpendicular offset |
void |
setWidth(java.lang.Object width)Set the width |
Stroke |
shape(Shape shape)Add a Shape to this Stroke for creating spaced graphic symbols |
java.lang.String |
toString()The string representation |
| Methods inherited from class | Name |
|---|---|
interface org.geotools.styling.Symbolizer |
org.geotools.styling.Symbolizer#accept(org.geotools.styling.StyleVisitor), org.geotools.styling.Symbolizer#setName(java.lang.String), org.geotools.styling.Symbolizer#hasOption(java.lang.String), org.geotools.styling.Symbolizer#getOptions(), org.geotools.styling.Symbolizer#getDescription(), org.geotools.styling.Symbolizer#getDescription(), org.geotools.styling.Symbolizer#setDescription(org.opengis.style.Description), org.geotools.styling.Symbolizer#getGeometry(), org.geotools.styling.Symbolizer#setGeometry(org.opengis.filter.expression.Expression), org.geotools.styling.Symbolizer#setUnitOfMeasure(javax.measure.unit.Unit), org.geotools.styling.Symbolizer#getGeometryPropertyName(), org.geotools.styling.Symbolizer#setGeometryPropertyName(java.lang.String), org.geotools.styling.Symbolizer#getName(), org.geotools.styling.Symbolizer#accept(org.opengis.style.StyleVisitor, java.lang.Object), org.geotools.styling.Symbolizer#getUnitOfMeasure() |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The line cap (butt, round, square)
The color in hexadecimal format (#00FF00)
The dash pattern. Odd items specify length in pixels of the dash. Even items specify spaces.
The Hatch
The line join (miter, round, bevel)
The opacity (0: transparent - 1 opaque)
The perpendicular offset
The Shape for spaced graphics
The width (1, 2, 5, ect...)
Create a new Stroke.
def stroke = new Stroke("#ff0000", 0.25, [5,2], "round", "bevel")
color - The colorwidth - The widthdash - The dash patterncap - The line cap (round, butt, square)join - The line join (mitre, round, bevel)Create a new Stroke with named parameters.
def stroke = new Stroke(width: 1.2, dash: [5,2], color: "#ff00ff", opacity: 0.75)
map - A Map of named parameters.Apply this Symbolizer to the GeoTools Symbolizer
sym - The GeoTools SymbolizerCreate a GeoTools Stroke from this GeoScript Stroke
Add a Hatch pattern to this Stroke
name - The pattern namestroke - The Strokesize - The sizeSet the perpendicular offset
offset - The offsetPrepare the GeoTools Rule by applying this Symbolizer
rule - The GeoTools RuleSet the line cap(butt, round, square)
cap - The line capSet the color
color - The color (#ffffff, red)Set the line join(miter, round, bevel)
join - The line joinSet the opacity (0: transparent - 1 opaque)
opacity - The opacity (0: transparent - 1 opaque)Set the perpendicular offset
offset - The offsetSet the width
width - The widthAdd a Shape to this Stroke for creating spaced graphic symbols
shape - The ShapeThe string representation
Groovy Documentation