Search in sources :

Example 21 with Graphic

use of org.opengis.style.Graphic in project geotoolkit by Geomatys.

the class SE110toGTTransformer method visit.

/**
 * Transform a SLD v1.1 point symbolizer in GT point symbolizer.
 */
public PointSymbolizer visit(final PointSymbolizerType pst) {
    if (pst == null)
        return null;
    final Graphic graphic = (pst.getGraphic() == null) ? styleFactory.graphic() : visit(pst.getGraphic());
    final Unit uom = visitUOM(pst.getUom());
    final Expression geom = notEmpty(visitExpression(pst.getGeometry()));
    final String name = pst.getName();
    final Description desc = visitDescription(pst.getDescription());
    return styleFactory.pointSymbolizer(name, geom, desc, uom, graphic);
}
Also used : Description(org.opengis.style.Description) Expression(org.opengis.filter.Expression) Graphic(org.opengis.style.Graphic) ExternalGraphic(org.opengis.style.ExternalGraphic) Unit(javax.measure.Unit)

Example 22 with Graphic

use of org.opengis.style.Graphic in project geotoolkit by Geomatys.

the class GTtoSE110Transformer method visit.

/**
 * Transform a GT graphicLegend in jaxb graphic legend
 */
@Override
public LegendGraphicType visit(final GraphicLegend graphicLegend, final Object data) {
    final LegendGraphicType lgt = se_factory.createLegendGraphicType();
    lgt.setGraphic(visit((Graphic) graphicLegend, null));
    return lgt;
}
Also used : LegendGraphicType(org.geotoolkit.se.xml.v110.LegendGraphicType) Graphic(org.opengis.style.Graphic) ExternalGraphic(org.opengis.style.ExternalGraphic)

Example 23 with Graphic

use of org.opengis.style.Graphic in project geotoolkit by Geomatys.

the class GTtoSE110Transformer method visit.

/**
 * Transform a GT graphic fill in jaxb graphic fill.
 */
@Override
public GraphicFillType visit(final GraphicFill graphicFill, final Object data) {
    final GraphicFillType gft = se_factory.createGraphicFillType();
    gft.setGraphic(visit((Graphic) graphicFill, null));
    return gft;
}
Also used : GraphicFillType(org.geotoolkit.se.xml.v110.GraphicFillType) Graphic(org.opengis.style.Graphic) ExternalGraphic(org.opengis.style.ExternalGraphic)

Example 24 with Graphic

use of org.opengis.style.Graphic in project geotoolkit by Geomatys.

the class GTtoSE110Transformer method visit.

/**
 * Transform a GT graphic stroke in jaxb graphic stroke.
 */
@Override
public GraphicStrokeType visit(final GraphicStroke graphicStroke, final Object data) {
    final GraphicStrokeType gst = se_factory.createGraphicStrokeType();
    gst.setGraphic(visit((Graphic) graphicStroke, null));
    gst.setGap(visitExpression(graphicStroke.getGap()));
    gst.setInitialGap(visitExpression(graphicStroke.getInitialGap()));
    return gst;
}
Also used : GraphicStrokeType(org.geotoolkit.se.xml.v110.GraphicStrokeType) Graphic(org.opengis.style.Graphic) ExternalGraphic(org.opengis.style.ExternalGraphic)

Example 25 with Graphic

use of org.opengis.style.Graphic in project geotoolkit by Geomatys.

the class Tester method createPointSymbolizer.

private static PointSymbolizer createPointSymbolizer() {
    String name = "Point symbolizer name";
    Description desc = STYLE_FACTORY.description("Point symbolizer title", "Point symbolizer description");
    Unit uom = Units.POINT;
    String geom = "geom";
    List<GraphicalSymbol> symbols = new ArrayList<GraphicalSymbol>();
    symbols.add(STYLE_FACTORY.mark());
    Expression opacity = FILTER_FACTORY.literal(0.7);
    Expression size = FILTER_FACTORY.literal(32);
    Expression rotation = FILTER_FACTORY.literal(110);
    AnchorPoint anchor = STYLE_FACTORY.anchorPoint(23, 12);
    Displacement disp = STYLE_FACTORY.displacement(21, 15);
    Graphic graphic = STYLE_FACTORY.graphic(symbols, opacity, size, rotation, anchor, disp);
    return STYLE_FACTORY.pointSymbolizer(name, geom, desc, uom, graphic);
}
Also used : Description(org.opengis.style.Description) AnchorPoint(org.opengis.style.AnchorPoint) Expression(org.opengis.filter.Expression) Graphic(org.opengis.style.Graphic) GraphicalSymbol(org.opengis.style.GraphicalSymbol) ArrayList(java.util.ArrayList) SimpleInternationalString(org.apache.sis.util.SimpleInternationalString) Unit(javax.measure.Unit) Displacement(org.opengis.style.Displacement)

Aggregations

Graphic (org.opengis.style.Graphic)29 ArrayList (java.util.ArrayList)16 Expression (org.opengis.filter.Expression)16 GraphicalSymbol (org.opengis.style.GraphicalSymbol)15 ExternalGraphic (org.opengis.style.ExternalGraphic)13 PointSymbolizer (org.opengis.style.PointSymbolizer)13 Unit (javax.measure.Unit)10 Description (org.opengis.style.Description)10 Stroke (org.opengis.style.Stroke)10 Fill (org.opengis.style.Fill)9 MutableStyle (org.geotoolkit.style.MutableStyle)8 AnchorPoint (org.opengis.style.AnchorPoint)8 Displacement (org.opengis.style.Displacement)8 Mark (org.opengis.style.Mark)8 LineSymbolizer (org.opengis.style.LineSymbolizer)5 Test (org.junit.Test)4 PolygonSymbolizer (org.opengis.style.PolygonSymbolizer)4 FeatureSet (org.apache.sis.storage.FeatureSet)3 SimpleInternationalString (org.apache.sis.util.SimpleInternationalString)3 Feature (org.opengis.feature.Feature)3