Package org.geotools.styling
Class RasterSymbolizerImpl
- Object
-
- AbstractSymbolizer
-
- RasterSymbolizerImpl
-
- All Implemented Interfaces:
Cloneable
,RasterSymbolizer
,Symbolizer
public class RasterSymbolizerImpl extends AbstractSymbolizer implements RasterSymbolizer, Cloneable
Default implementation of RasterSymbolizer.- Author:
- iant, Johann Sorel (Geomatys)
-
-
Field Summary
-
Fields inherited from class AbstractSymbolizer
description, geometry, name, options, unitOfMeasure
-
-
Constructor Summary
Constructors Constructor Description RasterSymbolizerImpl()
RasterSymbolizerImpl(FilterFactory factory)
RasterSymbolizerImpl(FilterFactory factory, Description desc, String name, Unit<Length> uom, OverlapBehaviorEnum behavior)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(StyleVisitor visitor)
Object
accept(TraversingStyleVisitor visitor, Object data)
calls the visit method of a StyleVisitorObject
clone()
Creates a deep copy clone.boolean
equals(Object obj)
ChannelSelection
getChannelSelection()
The ChannelSelection element specifies the false-color channel selection for a multi-spectral raster source (such as a multi-band satellite-imagery source).ColorMapImpl
getColorMap()
The ColorMap element defines either the colors of a palette-type raster source or the mapping of fixed-numeric pixel values to colors.ContrastEnhancementImpl
getContrastEnhancement()
The ContrastEnhancement element defines contrast enhancement for a channel of a false-color image or for a color image.Symbolizer
getImageOutline()
The ImageOutline element specifies that individual source rasters in a multi-raster set (such as a set of satellite-image scenes) should be outlined with either a LineStringSymbol or PolygonSymbol.Expression
getOpacity()
fetch the expresion which evaluates to the opacity fo rthis coverageExpression
getOverlap()
The OverlapBehavior element tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes.OverlapBehaviorEnum
getOverlapBehavior()
The OverlapBehavior element tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes.ShadedRelief
getShadedRelief()
The ShadedRelief element selects the application of relief shading (or ?int
hashCode()
void
setChannelSelection(ChannelSelection channel)
The ChannelSelection element specifies the false-color channel selection for a multi-spectral raster source (such as a multi-band satellite-imagery source).void
setColorMap(ColorMap colorMap)
The ColorMap element defines either the colors of a palette-type raster source or the mapping of fixed-numeric pixel values to colors.void
setContrastEnhancement(ContrastEnhancement contrastEnhancement)
The ContrastEnhancement element defines contrast enhancement for a channel of a false-color image or for a color image.void
setImageOutline(Symbolizer symbolizer)
The ImageOutline element specifies that individual source rasters in a multi-raster set (such as a set of satellite-image scenes) should be outlined with either a LineStringSymbol or PolygonSymbol.void
setOpacity(Expression opacity)
sets the opacity for the coverage, it has the usual meaning.void
setOverlap(Expression overlap)
The OverlapBehavior element tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes.void
setOverlapBehavior(OverlapBehaviorEnum overlapBehavior)
Set the overlap behavior.void
setShadedRelief(ShadedRelief shadedRelief)
The ShadedRelief element selects the application of relief shading (or ?-
Methods inherited from class AbstractSymbolizer
getDescription, getGeometry, getGeometryPropertyName, getName, getOptions, getUnitOfMeasure, hasOption, setDescription, setGeometry, setGeometryPropertyName, setName, setUnitOfMeasure
-
Methods inherited from class Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface Symbolizer
getDescription, getGeometry, getGeometryPropertyName, getName, getOptions, getUnitOfMeasure, hasOption, setDescription, setGeometry, setGeometryPropertyName, setName, setUnitOfMeasure
-
-
-
-
Constructor Detail
-
RasterSymbolizerImpl
public RasterSymbolizerImpl()
-
RasterSymbolizerImpl
public RasterSymbolizerImpl(FilterFactory factory)
-
RasterSymbolizerImpl
public RasterSymbolizerImpl(FilterFactory factory, Description desc, String name, Unit<Length> uom, OverlapBehaviorEnum behavior)
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractSymbolizer
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractSymbolizer
-
getChannelSelection
public ChannelSelection getChannelSelection()
The ChannelSelection element specifies the false-color channel selection for a multi-spectral raster source (such as a multi-band satellite-imagery source). Either a channel may be selected to display in each of red, green, and blue, or a single channel may be selected to display in grayscale. (The spelling ?gray? is used since it seems to be more common on the Web than ?grey? by a ratio of about 3:1.) Contrast enhancement may be applied to each channel in isolation. Channels are identified by a system and data-dependent character identifier. Commonly, channels will be labelled as ?1?, ?2?, etc.- Specified by:
getChannelSelection
in interfaceRasterSymbolizer
- Returns:
- the ChannelSelection object set or null if none is available.
-
getColorMap
public ColorMapImpl getColorMap()
The ColorMap element defines either the colors of a palette-type raster source or the mapping of fixed-numeric pixel values to colors. For example, a DEM raster giving elevations in meters above sea level can be translated to a colored image with a ColorMap. The quantity attributes of a color-map are used for translating between numeric matrixes and color rasters and the ColorMap entries should be in order of increasing numeric quantity so that intermediate numeric values can be matched to a color (or be interpolated between two colors). Labels may be used for legends or may be used in the future to match character values. Not all systems can support opacity in colormaps. The default opacity is 1.0 (fully opaque). Defaults for quantity and label are system-dependent.- Specified by:
getColorMap
in interfaceRasterSymbolizer
- Returns:
- the ColorMap for the raster
-
getContrastEnhancement
public ContrastEnhancementImpl getContrastEnhancement()
The ContrastEnhancement element defines contrast enhancement for a channel of a false-color image or for a color image. In the case of a color image, the relative grayscale brightness of a pixel color is used. ?Normalize? means to stretch the contrast so that the dimmest color is stretched to black and the brightest color is stretched to white, with all colors in between stretched out linearly. ?Histogram? means to stretch the contrast based on a histogram of how many colors are at each brightness level on input, with the goal of producing equal number of pixels in the image at each brightness level on output. This has the effect of revealing many subtle ground features. A ?GammaValue? tells how much to brighten (value greater than 1.0) or dim (value less than 1.0) an image. The default GammaValue is 1.0 (no change). If none of Normalize, Histogram, or GammaValue are selected in a ContrastEnhancement, then no enhancement is performed.- Specified by:
getContrastEnhancement
in interfaceRasterSymbolizer
- Returns:
- the ContrastEnhancement
-
getImageOutline
public Symbolizer getImageOutline()
The ImageOutline element specifies that individual source rasters in a multi-raster set (such as a set of satellite-image scenes) should be outlined with either a LineStringSymbol or PolygonSymbol. It is defined as:<xs:element name="ImageOutline"> <xs:complexType> <xs:choice> <xs:element ref="sld:LineSymbolizer"/> <xs:element ref="sld:PolygonSymbolizer"/> </xs:choice> </xs:complexType> </xs:element>
An Opacity of 0.0 can be selected for the main raster to avoid rendering the main-raster pixels, or an opacity can be used for a PolygonSymbolizer Fill to allow the main-raster data be visible through the fill.- Specified by:
getImageOutline
in interfaceRasterSymbolizer
- Returns:
- The relevent symbolizer
-
getOpacity
public Expression getOpacity()
fetch the expresion which evaluates to the opacity fo rthis coverage- Specified by:
getOpacity
in interfaceRasterSymbolizer
- Returns:
- The expression
-
getOverlap
public Expression getOverlap()
The OverlapBehavior element tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes. LATEST_ON_TOP and EARLIEST_ON_TOP refer to the time the scene was captured. AVERAGE means to average multiple scenes together. This can produce blurry results if the source images are not perfectly aligned in their geo-referencing. RANDOM means to select an image (or piece thereof) randomly and place it on top. This can produce crisper results than AVERAGE potentially more efficiently than LATEST_ON_TOP or EARLIEST_ON_TOP. The default behaviour is system-dependent.- Specified by:
getOverlap
in interfaceRasterSymbolizer
- Returns:
- The expression which evaluates to LATEST_ON_TOP, EARLIEST_ON_TOP, AVERAGE or RANDOM
-
getOverlapBehavior
public OverlapBehaviorEnum getOverlapBehavior()
Description copied from interface:RasterSymbolizer
The OverlapBehavior element tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes. LATEST_ON_TOP and EARLIEST_ON_TOP refer to the time the scene was captured. AVERAGE means to average multiple scenes together. This can produce blurry results if the source images are not perfectly aligned in their geo-referencing. RANDOM means to select an image (or piece thereof) randomly and place it on top. This can produce crisper results than AVERAGE potentially more efficiently than LATEST_ON_TOP or EARLIEST_ON_TOP. The default behaviour is system-dependent.- Specified by:
getOverlapBehavior
in interfaceRasterSymbolizer
- Returns:
- LATEST_ON_TOP,EARLIEST_ON_TOP, AVERAGE or RANDOM
-
setOverlapBehavior
public void setOverlapBehavior(OverlapBehaviorEnum overlapBehavior)
Description copied from interface:RasterSymbolizer
Set the overlap behavior.- Specified by:
setOverlapBehavior
in interfaceRasterSymbolizer
-
getShadedRelief
public ShadedRelief getShadedRelief()
The ShadedRelief element selects the application of relief shading (or ?hill shading?) to an image for a three-dimensional visual effect. It is defined as: Exact parameters of the shading are system-dependent (for now). If the BrightnessOnly flag is ?0? (false, default), the shading is applied to the layer being rendered as the current RasterSymbol. If BrightnessOnly is ?1? (true), the shading is applied to the brightness of the colors in the rendering canvas generated so far by other layers, with the effect of relief-shading these other layers. The default for BrightnessOnly is ?0? (false). The ReliefFactor gives the amount of exaggeration to use for the height of the ?hills.? A value of around 55 (times) gives reasonable results for Earth-based DEMs. The default value is system-dependent.- Specified by:
getShadedRelief
in interfaceRasterSymbolizer
- Returns:
- the shadedrelief object
-
setChannelSelection
public void setChannelSelection(ChannelSelection channel)
The ChannelSelection element specifies the false-color channel selection for a multi-spectral raster source (such as a multi-band satellite-imagery source). Either a channel may be selected to display in each of red, green, and blue, or a single channel may be selected to display in grayscale. (The spelling ?gray? is used since it seems to be more common on the Web than ?grey? by a ratio of about 3:1.) Contrast enhancement may be applied to each channel in isolation. Channels are identified by a system and data-dependent character identifier. Commonly, channels will be labelled as ?1?, ?2?, etc.- Specified by:
setChannelSelection
in interfaceRasterSymbolizer
- Parameters:
channel
- the channel selected
-
setColorMap
public void setColorMap(ColorMap colorMap)
The ColorMap element defines either the colors of a palette-type raster source or the mapping of fixed-numeric pixel values to colors. For example, a DEM raster giving elevations in meters above sea level can be translated to a colored image with a ColorMap. The quantity attributes of a color-map are used for translating between numeric matrixes and color rasters and the ColorMap entries should be in order of increasing numeric quantity so that intermediate numeric values can be matched to a color (or be interpolated between two colors). Labels may be used for legends or may be used in the future to match character values. Not all systems can support opacity in colormaps. The default opacity is 1.0 (fully opaque). Defaults for quantity and label are system-dependent.- Specified by:
setColorMap
in interfaceRasterSymbolizer
- Parameters:
colorMap
- the ColorMap for the raster
-
setContrastEnhancement
public void setContrastEnhancement(ContrastEnhancement contrastEnhancement)
The ContrastEnhancement element defines contrast enhancement for a channel of a false-color image or for a color image. In the case of a color image, the relative grayscale brightness of a pixel color is used. ?Normalize? means to stretch the contrast so that the dimmest color is stretched to black and the brightest color is stretched to white, with all colors in between stretched out linearly. ?Histogram? means to stretch the contrast based on a histogram of how many colors are at each brightness level on input, with the goal of producing equal number of pixels in the image at each brightness level on output. This has the effect of revealing many subtle ground features. A ?GammaValue? tells how much to brighten (value greater than 1.0) or dim (value less than 1.0) an image. The default GammaValue is 1.0 (no change). If none of Normalize, Histogram, or GammaValue are selected in a ContrastEnhancement, then no enhancement is performed.- Specified by:
setContrastEnhancement
in interfaceRasterSymbolizer
- Parameters:
contrastEnhancement
- the contrastEnhancement
-
setImageOutline
public void setImageOutline(Symbolizer symbolizer)
The ImageOutline element specifies that individual source rasters in a multi-raster set (such as a set of satellite-image scenes) should be outlined with either a LineStringSymbol or PolygonSymbol. It is defined as:<xs:element name="ImageOutline"> <xs:complexType> <xs:choice> <xs:element ref="sld:LineSymbolizer"/> <xs:element ref="sld:PolygonSymbolizer"/> </xs:choice> </xs:complexType> </xs:element>
An Opacity of 0.0 can be selected for the main raster to avoid rendering the main-raster pixels, or an opacity can be used for a PolygonSymbolizer Fill to allow the main-raster data be visible through the fill.- Specified by:
setImageOutline
in interfaceRasterSymbolizer
- Parameters:
symbolizer
- the symbolizer to be used. If this is not a polygon or a line symbolizer an unexpected argument exception may be thrown by an implementing class.
-
setOpacity
public void setOpacity(Expression opacity)
sets the opacity for the coverage, it has the usual meaning.- Specified by:
setOpacity
in interfaceRasterSymbolizer
- Parameters:
opacity
- An expression which evaluates to the the opacity (0-1)
-
setOverlap
public void setOverlap(Expression overlap)
The OverlapBehavior element tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes. LATEST_ON_TOP and EARLIEST_ON_TOP refer to the time the scene was captured. AVERAGE means to average multiple scenes together. This can produce blurry results if the source images are not perfectly aligned in their geo-referencing. RANDOM means to select an image (or piece thereof) randomly and place it on top. This can produce crisper results than AVERAGE potentially more efficiently than LATEST_ON_TOP or EARLIEST_ON_TOP. The default behaviour is system-dependent.- Specified by:
setOverlap
in interfaceRasterSymbolizer
- Parameters:
overlap
- the expression which evaluates to LATEST_ON_TOP, EARLIEST_ON_TOP, AVERAGE or RANDOM
-
setShadedRelief
public void setShadedRelief(ShadedRelief shadedRelief)
The ShadedRelief element selects the application of relief shading (or ?hill shading?) to an image for a three-dimensional visual effect. It is defined as: Exact parameters of the shading are system-dependent (for now). If the BrightnessOnly flag is ?0? (false, default), the shading is applied to the layer being rendered as the current RasterSymbol. If BrightnessOnly is ?1? (true), the shading is applied to the brightness of the colors in the rendering canvas generated so far by other layers, with the effect of relief-shading these other layers. The default for BrightnessOnly is ?0? (false). The ReliefFactor gives the amount of exaggeration to use for the height of the ?hills.? A value of around 55 (times) gives reasonable results for Earth-based DEMs. The default value is system-dependent.- Specified by:
setShadedRelief
in interfaceRasterSymbolizer
- Parameters:
shadedRelief
- the shadedrelief object
-
accept
public Object accept(TraversingStyleVisitor visitor, Object data)
Description copied from interface:RasterSymbolizer
calls the visit method of a StyleVisitor- Specified by:
accept
in interfaceRasterSymbolizer
- Specified by:
accept
in interfaceSymbolizer
- Parameters:
visitor
- the style visitor- Returns:
- value produced
-
accept
public void accept(StyleVisitor visitor)
- Specified by:
accept
in interfaceSymbolizer
-
-