The Gradient Composite Symbolizer creates gradients between a series of values and symbolizers or from values from Layer.
You can create a Gradient between a List of values and Styles:
Gradient gradient = new Gradient( new Expression("PERSONS / LAND_KM"), [0,200], [new Fill("#000066") + new Stroke("black",0.1), new Fill("red") + new Stroke("black",0.1)], 10, "exponential" )
Or you can create a Gradient based on a classification method and a list of colors or a color brewer palette:
Gradient gradient = new Gradient(shapefile, "WORKERS", "Quantile", 5, "Greens")
Fields inherited from class | Fields |
---|---|
class Symbolizer |
filterFactory, styleBuilder, styleFactory, styleOptions |
Constructor and description |
---|
Gradient
(java.lang.Object expression, java.util.List values, java.util.List styles, int classes = 5, java.lang.String method = "linear", boolean inclusive = true) Create a new Gradient by interpolating between a List of values and styles. |
Gradient
(Layer layer, java.lang.Object field, java.lang.String method, int number, java.lang.Object colors, java.lang.String elseMode = "ignore") Create a new Gradient where the interpolation is based on a classification method based on values from the Layer's Field. |
Type Params | Return Type | Name and description |
---|---|---|
|
static java.util.List |
createGraduatedSymbolizer(Layer layer, java.lang.String field, java.lang.String method, int number, java.lang.Object colors, java.lang.String elseMode = "ignore") Create a graduated Symbolizer |
Methods inherited from class | Name |
---|---|
class Composite |
range, toString, where, zindex |
class Symbolizer |
and, apply, asSLD, asSLD, buildString, composite, createGeoToolsSymbolizer, getDefault, getDefault, getGeoToolsSymbolizers, getGtStyle, getSld, plus, prepare, prepare, range, range, sortBy, sortBy, where, zindex |
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() |
Create a new Gradient by interpolating between a List of values and styles.
expression
- An Expression or a String expression.values
- A List of valuesstyles
- A List of Stylesclasses
- The number of classesmethod
- The interpolation method (linear, exponential, logarithmic)inclusive
- Whether to include the last value of notCreate a new Gradient where the interpolation is based on a classification method based on values from the Layer's Field.
layer
- The Layerfield
- The Field or Field's namemethod
- The classification method (Quantile or EqualInterval)number
- The number of categoriescolors
- A Color Brewer palette name, or a List of ColorselseMode
- The else mode (ignore, min, max)Create a graduated Symbolizer
layer
- The Layerfield
- The Field namemethod
- The classification method (Quantile or EqualInterval)number
- The number of categoriescolors
- A Palette name, or a List of ColorselseMode
- The else mode (ignore, min, max)