Package org.geotools.styling

Examples of org.geotools.styling.StyleBuilder.createStyle()


                    return geomStyle;
                } else {
                    symbolizer = builder.createPointSymbolizer();
                }
            }
            style = builder.createStyle(symbolizer);
        }
        return style;
    }

    private Symbolizer createMapOverviewStyle(@Nonnull final StyleBuilder builder) {
View Full Code Here


        Mark mark = sb.createMark("square");
        mark.setStroke(null);
        Graphic graphic = sb.createGraphic(null, mark, null);
        graphic.setSize(NilExpression.NIL);
        PointSymbolizer ps = sb.createPointSymbolizer(graphic);
        Style style = sb.createStyle(ps);
       
        MetaBufferEstimator estimator = new MetaBufferEstimator();
        style.accept(estimator);
        assertTrue(estimator.isEstimateAccurate());
        assertEquals(16, estimator.getBuffer());
View Full Code Here

        Mark mark = sb.createMark("square");
        mark.getStroke().setWidth(sb.getFilterFactory().literal(10));
        Graphic graphic = sb.createGraphic(null, mark, null);
        graphic.setSize(NilExpression.NIL);
        PointSymbolizer ps = sb.createPointSymbolizer(graphic);
        Style style = sb.createStyle(ps);
       
        MetaBufferEstimator estimator = new MetaBufferEstimator();
        style.accept(estimator);
        assertTrue(estimator.isEstimateAccurate());
        assertEquals(26, estimator.getBuffer());
View Full Code Here

   
    @Test
    public void testNullStroke() throws Exception {
        StyleBuilder sb = new StyleBuilder();
        LineSymbolizer ls = sb.createLineSymbolizer(Stroke.NULL);
        Style style = sb.createStyle(ls);
       
        MetaBufferEstimator estimator = new MetaBufferEstimator();
        style.accept(estimator);
        assertTrue(estimator.isEstimateAccurate());
        assertEquals(0, estimator.getBuffer());
View Full Code Here

        mark.setStroke(null);
        Graphic graphic = sb.createGraphic(null, mark, null);
        FilterFactory2 ff = sb.getFilterFactory();
        graphic.setSize(ff.function("env", ff.literal("test")));
        PointSymbolizer ps = sb.createPointSymbolizer(graphic);
        Style style = sb.createStyle(ps);

        try {
            EnvFunction.setGlobalValue("test", 10);
            MetaBufferEstimator estimator = new MetaBufferEstimator();
            style.accept(estimator);
View Full Code Here

        TextSymbolizer ts = sb.createTextSymbolizer();
        ts.setFont(sb.createFont("Bitstream Vera Sans", 20));
        ts.setLabel(sb.getFilterFactory().literal("name"));
        ts.setLabelPlacement(pp);
        ts.getOptions().put("partials", "true");
        return sb.createStyle(ts);
    }

    protected int countNonBlankPixels(BufferedImage image) {
        int pixelsDiffer = 0;
View Full Code Here

    @Test
    public void testSpatialNoReprojection() throws Exception {
        // a spatial filter in the same SRS as the geometry
        StyleBuilder sb = new StyleBuilder();
        PolygonSymbolizer ps = sb.createPolygonSymbolizer();
        Style style = sb.createStyle(ps);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        rule.setFilter(ff.bbox("geom", 1, 1, 4, 4, "EPSG:4326"));

        content.addLayer(new FeatureLayer(squareFS, style));
View Full Code Here

    @Test
    public void testSpatialDefaulter() throws Exception {
        // a spatial filter in the same SRS as the geometry
        StyleBuilder sb = new StyleBuilder();
        PolygonSymbolizer ps = sb.createPolygonSymbolizer();
        Style style = sb.createStyle(ps);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        rule.setFilter(ff.bbox("geom", 1, 1, 4, 4, null));

        content.addLayer(new FeatureLayer(squareFS, style));
View Full Code Here

    public void testSpatialDefaulterForceEPSG() throws Exception {
        // a spatial filter in the same SRS as the geometry... but with a different axis order
        // interpretation, if we assume lat/lon we should pick point.4
        StyleBuilder sb = new StyleBuilder();
        Symbolizer ps = sb.createPointSymbolizer();
        Style style = sb.createStyle(ps);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        rule.setFilter(ff.bbox("geom", 5, 1, 7, 3, null));
       
        // force EPSG axis order interpretation
        renderer.setRendererHints(Collections.singletonMap(StreamingRenderer.FORCE_EPSG_AXIS_ORDER_KEY, true));
View Full Code Here

        ReferencedEnvelope envWgs84 = new ReferencedEnvelope(1, 3, 5, 7, wgs84);
        ReferencedEnvelope envUTM31N = envWgs84.transform(utm31n, true);
       
        StyleBuilder sb = new StyleBuilder();
        Symbolizer ps = sb.createPointSymbolizer();
        Style style = sb.createStyle(ps);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        rule.setFilter(ff.bbox("geom", envUTM31N.getMinX(), envUTM31N.getMinY(), envUTM31N.getMaxX(), envUTM31N.getMaxY(), "EPSG:32631"));
       
        // force EPSG axis order interpretation
        renderer.setRendererHints(Collections.singletonMap(StreamingRenderer.FORCE_EPSG_AXIS_ORDER_KEY, true));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.