A ColorMap is a Symbolizer used to style Rasters by mapping pixel values to colors.
You can create a ColorMap from a List of Maps with color and quantity keys (opacity and label keys are optional):
def colorMap = new ColorMap([[color: "#008000", quantity:70], [color:"#663333", quantity:256, opacity: 0, label: "NO DATA"]])
Or you can create a ColorMap for a Raster from a ColorBrewer color palette:
def colorMap = new ColorMap(raster,"Greens", 5)
Or you can create a ColorMap for min and max values from a List of Colors:
def colorMap = new ColorMap(min, max, Color.getPaletteColors("Greens", 5))
| Constructor and description |
|---|
ColorMap
(java.util.List values, java.lang.String type = "ramp", boolean extended = false)Create a new ColorMap |
ColorMap
(java.util.Map map)Create a new ColorMap. |
ColorMap
(Raster raster, java.lang.String palette, int numberOfCategories, int band = 0, java.lang.String type = "ramp", boolean extended = false)Create a ColorMap for a Raster with a palette of colors (from Color Brewer) with the given number of categories |
ColorMap
(double min, double max, java.lang.String palette, int numberOfCategories, java.lang.String type = "ramp", boolean extended = false)Create a ColorMap for a min and max values with a palette of colors (from Color Brewer) with the given |
ColorMap
(Raster raster, java.util.List colors, int band = 0, java.lang.String type = "ramp", boolean extended = false)Create a ColorMap for a Raster from a list of colors |
ColorMap
(double min, double max, java.util.List colors, java.lang.String type = "ramp", boolean extended = false)Create a ColorMap for min and max values with a List of colors |
| Type | Name and description |
|---|---|
protected void |
apply(org.geotools.styling.Symbolizer sym)Apply this Symbolizer to the GeoTools Symbolizer |
protected org.geotools.styling.ColorMap |
generateColorMap(java.util.List<java.util.Map> values, java.lang.String type, boolean extended)Generate a GeoTool's ColorMap from A List of Maps with color, opacity, quantity, and label keys |
protected void |
prepare(org.geotools.styling.Rule rule)Prepare the GeoTools Rule by applying this Symbolizer |
java.lang.String |
toString()The string representation |
| Methods inherited from class | Name |
|---|---|
class RasterSymbolizer |
apply, geometry, opacity, overlap, prepare, setGeometry, setOpacity, setOverlap, toString |
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() |
Whether to use extended colors or not
The ColorMap type (intervals, values, ramp)
A List of ColorMap values
Create a new ColorMap
values - A List of ColorMap valuestype - The typeextended - Whether to use extended colorsCreate a new ColorMap.
map - A Map of named parameters.Create a ColorMap for a Raster with a palette of colors (from Color Brewer) with the given number of categories
raster - The Rasterpalette - The color palette name (from Color Brewer)numberOfCategories - The number of categoriesband - The band to use for min and max valuestype - The type of interpolationextended - Whether to use extended colorsCreate a ColorMap for a min and max values with a palette of colors (from Color Brewer) with the given
min - The min valuemax - The max valuepalette - The color palette name (from Color Brewer)numberOfCategories - The number of categoriestype - The type of interpolationextended - Whether to use extended colorsCreate a ColorMap for a Raster from a list of colors
raster - The Rastercolors - The list of colorsband - The band The bandtype - The type of interpolationextended - Whether to use extended colorsCreate a ColorMap for min and max values with a List of colors
min - The min valuemax - The max valuecolors - The list of colorstype - The type of interpolationextended - Whether to use extended colorsApply this Symbolizer to the GeoTools Symbolizer
sym - The GeoTools SymbolizerGenerate a GeoTool's ColorMap from A List of Maps with color, opacity, quantity, and label keys
values - A List of MapsPrepare the GeoTools Rule by applying this Symbolizer
rule - The GeoTools RuleThe string representation
Groovy Documentation