Package org.geotools.styling

Examples of org.geotools.styling.PointSymbolizer


        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertSimpleStyle(collector);

        // check the size and rotation
        PointSymbolizer ps = (PointSymbolizer) collector.symbolizers.get(0);
        Graphic graphic = ps.getGraphic();
        assertEquals(32, (int) graphic.getSize().evaluate(null, Integer.class));

        // check the mark
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
View Full Code Here


        assertEquals(1, collector.featureTypeStyles.size());
        assertEquals(1, collector.rules.size());
        assertEquals(2, collector.symbolizers.size());

        // check the size and rotation of the point symbolizer
        PointSymbolizer ps = (PointSymbolizer) collector.symbolizers.get(0);
        Graphic graphic = ps.getGraphic();
        assertEquals(6, (int) graphic.getSize().evaluate(null, Integer.class));

        // check the mark
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
View Full Code Here

        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertSimpleStyle(collector);

        // check the function is there were we expect it
        PointSymbolizer ps = (PointSymbolizer) collector.symbolizers.get(0);
        Graphic graphic = ps.getGraphic();
        assertTrue(graphic.getSize() instanceof CategorizeFunction);
    }
View Full Code Here

    }

    private void checkAttributeBasedRule(Rule rule, Filter filter, int size) {
        assertEquals(filter, rule.getFilter());
        assertEquals(1, rule.getSymbolizers().length);
        PointSymbolizer ps = (PointSymbolizer) rule.getSymbolizers()[0];
        assertEquals(size, (int) ps.getGraphic().getSize().evaluate(null, Integer.class));
    }
View Full Code Here

            double maxDenominator, int size) {
        assertEquals(name, rule.getName());
        assertEquals(minDenominator, rule.getMinScaleDenominator(), 0.0);
        assertEquals(maxDenominator, rule.getMaxScaleDenominator(), 0.0);
        assertEquals(1, rule.getSymbolizers().length);
        PointSymbolizer ps = (PointSymbolizer) rule.getSymbolizers()[0];
        assertEquals(size, (int) ps.getGraphic().getSize().evaluate(null, Integer.class));
    }
View Full Code Here

        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertSimpleStyle(collector);

        PointSymbolizer ps = (PointSymbolizer) collector.symbolizers.get(0);
        assertEquals(SI.METER, ps.getUnitOfMeasure());
    }
View Full Code Here

            features.add(fb.buildFeature(null));
        }

        // setup a point layer with the right geometry trnasformation
        Style style = SLD.createPointStyle("circle", Color.BLUE, Color.BLUE, 1f, 10f);
        PointSymbolizer ps = (PointSymbolizer) style.featureTypeStyles().get(0).rules().get(0).symbolizers().get(0);
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        ps.setGeometry(ff.function("convert", ff.property("wkt"), ff.literal(Point.class)));

        // setup the map
        MapContent map = new MapContent();
        Layer layer = new FeatureLayer(features, style);
        map.addLayer(layer);
View Full Code Here

   
    @Override
    protected Expression rescaleGraphicSize(Graphic gr) {
        Expression size = gr.getSize();
        if(size == null || size == Expression.NIL) {
            PointSymbolizer symbolizer = sf.createPointSymbolizer(gr, null);
            Style2D style = ssf.createStyle(null, symbolizer, INFINITE_RANGE);
            if(style instanceof IconStyle2D) {
                IconStyle2D is = (IconStyle2D) style;
                size = ff.literal(is.getIcon().getIconHeight());
            } else if(style instanceof GraphicStyle2D) {
View Full Code Here

   
    /** This test created from Render2DTest.testSimplePointRender */
    public void testCreatePointStyle(){
        // The following is complex, and should be built from
        // an SLD document and not by hand
        PointSymbolizer pointsym = sf.createPointSymbolizer();
        pointsym.setGraphic(sf.getDefaultGraphic());
        NumberRange<Double> scaleRange = NumberRange.create( 1.0,50000.0);
        Style2D style = sld.createPointStyle(null, pointsym, scaleRange);
        assertNotNull( style );
    }
View Full Code Here

   
    /**
     * Test of createPointStyle method, of class org.geotools.renderer.style.SLDStyleFactory.
     */
    public void testCreateCompletePointStyle() {
        PointSymbolizer symb;
        Mark myMark;
        //full symbolizer
        symb = sf.createPointSymbolizer();
        myMark = sf.createMark();
       
        myMark.setFill(sf.createFill(ff.literal("#ffff00")));
        symb.getGraphic().setSize(ff.literal(10));
        symb.getGraphic().addMark(myMark);
        symb.getGraphic().setOpacity(ff.literal(1));
        symb.getGraphic().setRotation(ff.literal(0));
        sld.createPointStyle(null, symb,range);
       
    }
View Full Code Here

TOP

Related Classes of org.geotools.styling.PointSymbolizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.