use of org.opengis.style.ColorMap in project geotoolkit by Geomatys.
the class Styles method colorInterpolationRaster.
public static MutableStyle colorInterpolationRaster() {
final List<InterpolationPoint> values = new ArrayList<>();
values.add(SF.interpolationPoint(1003, SF.literal(new Color(46, 154, 88))));
values.add(SF.interpolationPoint(1800, SF.literal(new Color(251, 255, 128))));
values.add(SF.interpolationPoint(2800, SF.literal(new Color(224, 108, 31))));
values.add(SF.interpolationPoint(3500, SF.literal(new Color(200, 55, 55))));
values.add(SF.interpolationPoint(4397, SF.literal(new Color(215, 244, 244))));
final Expression lookup = DEFAULT_CATEGORIZE_LOOKUP;
final Literal fallback = DEFAULT_FALLBACK;
final Expression function = SF.interpolateFunction(lookup, values, Method.COLOR, Mode.LINEAR, fallback);
final ChannelSelection selection = null;
final Expression opacity = LITERAL_ONE_FLOAT;
final OverlapBehavior overlap = OverlapBehavior.LATEST_ON_TOP;
final ColorMap colorMap = SF.colorMap(function);
final ContrastEnhancement enchance = SF.contrastEnhancement(LITERAL_ONE_FLOAT, ContrastMethod.NONE);
final ShadedRelief relief = SF.shadedRelief(LITERAL_ONE_FLOAT);
final Symbolizer outline = null;
final Unit uom = Units.POINT;
final String geom = DEFAULT_GEOM;
final String name = "raster symbol name";
final Description desc = DEFAULT_DESCRIPTION;
final RasterSymbolizer symbol = SF.rasterSymbolizer(name, geom, desc, uom, opacity, selection, overlap, colorMap, enchance, relief, outline);
return SF.style(symbol);
}
use of org.opengis.style.ColorMap in project geotoolkit by Geomatys.
the class Styles method customRaster.
public static MutableStyle customRaster() {
final String name = "mySymbol";
final Description desc = DEFAULT_DESCRIPTION;
// use the default geometry of the feature
final String geometry = null;
final Unit unit = Units.POINT;
final Expression opacity = LITERAL_ONE_FLOAT;
final ChannelSelection channels = null;
final OverlapBehavior overlap = null;
final ColorMap colormap = null;
final ContrastEnhancement enhance = null;
final ShadedRelief relief = null;
final Symbolizer outline = null;
final RasterSymbolizer symbol = SF.rasterSymbolizer(name, (String) null, desc, unit, opacity, channels, overlap, colormap, enhance, relief, outline);
final MutableStyle style = SF.style(symbol);
return style;
}
use of org.opengis.style.ColorMap in project geotoolkit by Geomatys.
the class SE100toGTTransformer method visit.
/**
* Transform a SLD v1.0 raster symbolizer in GT raster symbolizer.
*/
public RasterSymbolizer visit(final org.geotoolkit.sld.xml.v100.RasterSymbolizer rst) {
if (rst == null)
return null;
final Expression opacity = (rst.getOpacity() == null) ? filterFactory.literal(1) : visitExpression(rst.getOpacity());
final ChannelSelection selection = visit(rst.getChannelSelection());
final OverlapBehavior overlap = visitOverLap(rst.getOverlapBehavior());
final ColorMap colorMap = visit(rst.getColorMap());
final ContrastEnhancement enchance = visit(rst.getContrastEnhancement());
final ShadedRelief relief = visit(rst.getShadedRelief());
final Symbolizer outline = visit(rst.getImageOutline());
final Unit uom = Units.POINT;
final String geom = visitGeom(rst.getGeometry());
final String name = "";
final Description desc = StyleConstants.DEFAULT_DESCRIPTION;
return styleFactory.rasterSymbolizer(name, geom, desc, uom, opacity, selection, overlap, colorMap, enchance, relief, outline);
}
use of org.opengis.style.ColorMap in project geotoolkit by Geomatys.
the class SE110toGTTransformer method visit.
/**
* Transform a SLD v1.1 raster symbolizer in GT raster symbolizer.
*/
public RasterSymbolizer visit(final RasterSymbolizerType rst) {
if (rst == null)
return null;
final Expression opacity = (rst.getOpacity() == null) ? filterFactory.literal(1) : visitExpression(rst.getOpacity());
final ChannelSelection selection = visit(rst.getChannelSelection());
final OverlapBehavior overlap = visitOverLap(rst.getOverlapBehavior());
final ColorMap colorMap = visit(rst.getColorMap());
final ContrastEnhancement enchance = visit(rst.getContrastEnhancement());
final ShadedRelief relief = visit(rst.getShadedRelief());
final Symbolizer outline = visit(rst.getImageOutline());
final Unit uom = visitUOM(rst.getUom());
final Expression geom = notEmpty(visitExpression(rst.getGeometry()));
final String name = rst.getName();
final Description desc = visitDescription(rst.getDescription());
return styleFactory.rasterSymbolizer(name, geom, desc, uom, opacity, selection, overlap, colorMap, enchance, relief, outline);
}
use of org.opengis.style.ColorMap in project geotoolkit by Geomatys.
the class DefaultStyleVisitor method visit.
@Override
public Object visit(final RasterSymbolizer rasterSymbolizer, Object data) {
final ChannelSelection cs = rasterSymbolizer.getChannelSelection();
if (cs != null) {
data = cs.accept(this, data);
}
final ColorMap cm = rasterSymbolizer.getColorMap();
if (cm != null) {
data = cm.accept(this, data);
}
final ContrastEnhancement ce = rasterSymbolizer.getContrastEnhancement();
if (ce != null) {
data = ce.accept(this, data);
}
final Symbolizer sym = rasterSymbolizer.getImageOutline();
if (sym != null) {
data = sym.accept(this, data);
}
final Expression opa = rasterSymbolizer.getOpacity();
if (opa != null) {
visit(opa, data);
}
final ShadedRelief shade = rasterSymbolizer.getShadedRelief();
if (shade != null) {
data = shade.accept(this, data);
}
return data;
}
Aggregations