Search in sources :

Example 1 with RasterSymbolizerType

use of org.geotoolkit.se.xml.v110.RasterSymbolizerType in project geotoolkit by Geomatys.

the class GTtoSE110Transformer method visit.

/**
 * Transform a GT raster symbolizer in jaxb raster symbolizer.
 */
@Override
public JAXBElement<RasterSymbolizerType> visit(final RasterSymbolizer raster, final Object data) {
    final RasterSymbolizerType tst = se_factory.createRasterSymbolizerType();
    tst.setName(raster.getName());
    tst.setDescription(visit(raster.getDescription(), null));
    tst.setUom(visitUOM(raster.getUnitOfMeasure()));
    tst.setGeometry(visitExpression(raster.getGeometry()));
    if (raster.getChannelSelection() != null) {
        tst.setChannelSelection(visit(raster.getChannelSelection(), null));
    }
    if (raster.getColorMap() != null) {
        tst.setColorMap(visit(raster.getColorMap(), null));
    }
    if (raster.getContrastEnhancement() != null) {
        tst.setContrastEnhancement(visit(raster.getContrastEnhancement(), null));
    }
    if (raster.getImageOutline() != null) {
        final ImageOutlineType iot = se_factory.createImageOutlineType();
        if (raster.getImageOutline() instanceof LineSymbolizer) {
            final LineSymbolizer ls = (LineSymbolizer) raster.getImageOutline();
            iot.setLineSymbolizer(visit(ls, null).getValue());
            tst.setImageOutline(iot);
        } else if (raster.getImageOutline() instanceof PolygonSymbolizer) {
            final PolygonSymbolizer ps = (PolygonSymbolizer) raster.getImageOutline();
            iot.setPolygonSymbolizer(visit(ps, null).getValue());
            tst.setImageOutline(iot);
        }
    }
    tst.setOpacity(visitExpression(raster.getOpacity()));
    if (raster.getOverlapBehavior() != null) {
        tst.setOverlapBehavior(visit(raster.getOverlapBehavior(), null));
    }
    if (raster.getShadedRelief() != null) {
        tst.setShadedRelief(visit(raster.getShadedRelief(), null));
    }
    return se_factory.createRasterSymbolizer(tst);
}
Also used : PolygonSymbolizer(org.opengis.style.PolygonSymbolizer) LineSymbolizer(org.opengis.style.LineSymbolizer) ImageOutlineType(org.geotoolkit.se.xml.v110.ImageOutlineType) RasterSymbolizerType(org.geotoolkit.se.xml.v110.RasterSymbolizerType)

Aggregations

ImageOutlineType (org.geotoolkit.se.xml.v110.ImageOutlineType)1 RasterSymbolizerType (org.geotoolkit.se.xml.v110.RasterSymbolizerType)1 LineSymbolizer (org.opengis.style.LineSymbolizer)1 PolygonSymbolizer (org.opengis.style.PolygonSymbolizer)1