A Symbolizer for area/polygonal geometries. It consists of a color and an opacity. You can create a Fill from a color and opacity:
Or from named parameters:def fill = new Fill('#ff0000', 0.5)
def fill = new Fill(color: '#ff0000', opacity: 0.25)
Type | Name and description |
---|---|
Expression |
color The Color (#ff0000, red, [0,0.,255]) |
Hatch |
hatch The Hatch |
Icon |
icon The Icon |
Expression |
opacity The opacity (1.0 = opaque to 0.0 = transparent) |
Type | Name and description |
---|---|
protected void |
apply(org.geotools.styling.Symbolizer sym) Apply this Symbolizer to the GeoTools Symbolizer |
protected org.geotools.styling.Fill |
createFill() Create the GeoTools Fill object |
Fill |
hatch(java.lang.String name, Stroke stroke = new Stroke(, java.lang.Object size = 8) Compose this Fill with a Hatch pattern. |
Fill |
hatch(java.lang.String name, Fill fill, Stroke stroke, java.lang.Object size = 8) Compose this Fill with a Hatch pattern that has a Fill and Stroke. |
Fill |
hatch(java.lang.String name, Fill fill, java.lang.Object size = 8) Compose this Fill with a Hatch pattern that has a Fill but no Stroke |
Fill |
icon(java.lang.Object url, java.lang.String format) Compose this Fill as an Icon. |
protected void |
prepare(org.geotools.styling.Rule rule) Prepare the GeoTools Rule by applying this Symbolizer |
Fill |
random(java.util.Map params = [:]) Add randomized fill. |
void |
setColor(java.lang.Object color) Set the color |
void |
setOpacity(java.lang.Object opacity) Set the opacity |
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 Color (#ff0000, red, [0,0.,255])
The Hatch
The Icon
The opacity (1.0 = opaque to 0.0 = transparent)
Create a new Fill.
def f = new Fill(color: '#ff0000', opacity: 0.25)
map
- A Map of named parameters.Create a new Fill.
def f = new Fill('#ff0000', 0.5) def f = new Fill('red', 0.5) def f = new Fill([255,0,0], 0.5)
color
- The Coloropacity
- The opacity (1 opaque to 0 transparent)Apply this Symbolizer to the GeoTools Symbolizer
sym
- The GeoTools SymbolizerCreate the GeoTools Fill object
Compose this Fill with a Hatch pattern.
def f = new Fill().hatch('slash')
name
- The name of the hatch patternstroke
- The Strokesize
- The sizeCompose this Fill with a Hatch pattern that has a Fill and Stroke.
def f = new Fill().hatch('slash', new Fill("white"), new Stroke("blue",0.1), 8)
name
- The name of the hatch patternfill
- The Fillstroke
- The Strokesize
- The sizeCompose this Fill with a Hatch pattern that has a Fill but no Stroke
def f = new Fill().hatch('slash', new Fill("wheat"), 8)
name
- The name of the hatch patternfill
- The Fillsize
- The sizeCompose this Fill as an Icon.
def f = new Fill().icon('icon.png','image/png')
url
- The URL or File of the imageformat
- The mime type of the image.Prepare the GeoTools Rule by applying this Symbolizer
rule
- The GeoTools RuleAdd randomized fill. See http://osgeo-org.1560.x6.nabble.com/Randomized-fill-landed-on-trunk-td5081889.html for more details.
params
- Named parameters may include:
Set the color
color
- The color (#ffffff, red)Set the opacity
opacity
- The opacityThe string representation
Groovy Documentation