Search in sources :

Example 1 with RangeType

use of org.geotoolkit.se.xml.vext.RangeType in project geotoolkit by Geomatys.

the class PatternSymbolizer method setRanges.

public void setRanges(Map<Expression, List<Symbolizer>> range) {
    this.thredholds = new TreeMap<>(new ExpComparator());
    if (range != null)
        this.thredholds.putAll(range);
    final GTtoSLD110Transformer io = new StyleXmlIO().getTransformerXMLv110();
    final List<JAXBElement<RangeType>> ranges = new ArrayList<>();
    for (Entry<Expression, List<Symbolizer>> entry : this.thredholds.entrySet()) {
        final JAXBElement<RangeType> rt = io.visitRange(entry.getKey(), entry.getValue());
        ranges.add(rt);
    }
    this.range = ranges;
}
Also used : RangeType(org.geotoolkit.se.xml.vext.RangeType) Expression(org.opengis.filter.Expression) ArrayList(java.util.ArrayList) StyleXmlIO(org.geotoolkit.sld.xml.StyleXmlIO) GTtoSLD110Transformer(org.geotoolkit.sld.xml.GTtoSLD110Transformer) ArrayList(java.util.ArrayList) List(java.util.List) JAXBElement(javax.xml.bind.JAXBElement)

Example 2 with RangeType

use of org.geotoolkit.se.xml.vext.RangeType in project geotoolkit by Geomatys.

the class SE110toGTTransformer method visitRanges.

// Sub elements -------------------------------------------------------------
public Map<Expression, List<Symbolizer>> visitRanges(final List<JAXBElement<RangeType>> types) {
    final Map<Expression, List<Symbolizer>> ranges = new LinkedHashMap<Expression, List<Symbolizer>>();
    for (final JAXBElement<RangeType> type : types) {
        final RangeType rt = type.getValue();
        final Expression exp = visitExpression(rt.getThreshold());
        final List<Symbolizer> symbols = new ArrayList<Symbolizer>();
        for (final JAXBElement<? extends SymbolizerType> jst : rt.getSymbolizer()) {
            final SymbolizerType st = jst.getValue();
            if (st == null)
                continue;
            symbols.add(visit(st));
        }
        ranges.put(exp, symbols);
    }
    return ranges;
}
Also used : RangeType(org.geotoolkit.se.xml.vext.RangeType) Expression(org.opengis.filter.Expression) ArrayList(java.util.ArrayList) PointSymbolizerType(org.geotoolkit.se.xml.v110.PointSymbolizerType) SymbolizerType(org.geotoolkit.se.xml.v110.SymbolizerType) TextSymbolizerType(org.geotoolkit.se.xml.v110.TextSymbolizerType) LineSymbolizerType(org.geotoolkit.se.xml.v110.LineSymbolizerType) RasterSymbolizerType(org.geotoolkit.se.xml.v110.RasterSymbolizerType) PolygonSymbolizerType(org.geotoolkit.se.xml.v110.PolygonSymbolizerType) ArrayList(java.util.ArrayList) List(java.util.List) PolygonSymbolizer(org.opengis.style.PolygonSymbolizer) RasterSymbolizer(org.opengis.style.RasterSymbolizer) TextSymbolizer(org.opengis.style.TextSymbolizer) PointSymbolizer(org.opengis.style.PointSymbolizer) LineSymbolizer(org.opengis.style.LineSymbolizer) Symbolizer(org.opengis.style.Symbolizer) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ArrayList (java.util.ArrayList)2 List (java.util.List)2 RangeType (org.geotoolkit.se.xml.vext.RangeType)2 Expression (org.opengis.filter.Expression)2 LinkedHashMap (java.util.LinkedHashMap)1 JAXBElement (javax.xml.bind.JAXBElement)1 LineSymbolizerType (org.geotoolkit.se.xml.v110.LineSymbolizerType)1 PointSymbolizerType (org.geotoolkit.se.xml.v110.PointSymbolizerType)1 PolygonSymbolizerType (org.geotoolkit.se.xml.v110.PolygonSymbolizerType)1 RasterSymbolizerType (org.geotoolkit.se.xml.v110.RasterSymbolizerType)1 SymbolizerType (org.geotoolkit.se.xml.v110.SymbolizerType)1 TextSymbolizerType (org.geotoolkit.se.xml.v110.TextSymbolizerType)1 GTtoSLD110Transformer (org.geotoolkit.sld.xml.GTtoSLD110Transformer)1 StyleXmlIO (org.geotoolkit.sld.xml.StyleXmlIO)1 LineSymbolizer (org.opengis.style.LineSymbolizer)1 PointSymbolizer (org.opengis.style.PointSymbolizer)1 PolygonSymbolizer (org.opengis.style.PolygonSymbolizer)1 RasterSymbolizer (org.opengis.style.RasterSymbolizer)1 Symbolizer (org.opengis.style.Symbolizer)1 TextSymbolizer (org.opengis.style.TextSymbolizer)1