Package org.geotools.styling

Examples of org.geotools.styling.StyleBuilder$EqualClasses


        assertEquals(26, estimator.getBuffer());
    }
   
    @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


        assertEquals(0, estimator.getBuffer());
    }
   
    @Test
    public void testGraphicSizeFunction() throws Exception {
        StyleBuilder sb = new StyleBuilder();
        Mark mark = sb.createMark("square");
        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

        tb.add("geom", LineString.class, DefaultGeographicCRS.WGS84);
        schema = tb.buildFeatureType();
        fb = new SimpleFeatureBuilder(schema);
        cache = new LabelCacheImpl();
        cache.startLayer(LAYER_ID);
        sb = new StyleBuilder();
    }
View Full Code Here

        assertTrue(countNonBlankPixels(image) > 0);
    }


    private static Style createLabelOffsetStyle() {
        StyleBuilder sb = new StyleBuilder();
        PointPlacement pp = sb.createPointPlacement(0.5, 0.5, 50, 0, 0);
        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);
    }
View Full Code Here

        JAI.create("ImageRead", new File(TestData.url(this, "small_4bands_UInt16.tif").toURI())),
        new GeneralEnvelope(new double[] { -90, -180 },new double[] { 90, 180 }));
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);
    // build the RasterSymbolizer
    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeRed    = new SelectedChannelTypeImpl();
    final SelectedChannelType chTypeBlue     = new SelectedChannelTypeImpl();
    final SelectedChannelType chTypeGreen   = new SelectedChannelTypeImpl();
    final ContrastEnhancement cntEnh = new ContrastEnhancementImpl();

    cntEnh.setMethod(ContrastMethod.HISTOGRAM);;
    //cntEnh.setGammaValue(sldBuilder.literalExpression(0.50));
   
    chTypeRed.setChannelName("1");
    chTypeBlue.setChannelName("2");
    chTypeGreen.setChannelName("3");
   
    chSel.setRGBChannels(chTypeRed, chTypeBlue, chTypeGreen);

    rsb_1.setChannelSelection(chSel);
    rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
    rsb_1.setContrastEnhancement(cntEnh);
    rsb_1.setOverlap(sldBuilder.literalExpression("AVERAGE"));
   
    // visit the RasterSymbolizer
    rsh.visit(rsb_1);
   
    testRasterSymbolizerHelper(rsh);
View Full Code Here

        new GeneralEnvelope(new double[] { -90, -180 },
            new double[] { 90, 180 }));
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);
    // build the RasterSymbolizer
    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeRed    = new SelectedChannelTypeImpl();
    final SelectedChannelType chTypeBlue     = new SelectedChannelTypeImpl();
    final SelectedChannelType chTypeGreen   = new SelectedChannelTypeImpl();
    final ContrastEnhancement cntEnh = new ContrastEnhancementImpl();

    cntEnh.setMethod(ContrastMethod.HISTOGRAM);;
    cntEnh.setGammaValue(sldBuilder.literalExpression(0.50));
   
    chTypeRed.setChannelName("1");
    chTypeBlue.setChannelName("2");
    chTypeGreen.setChannelName("3");
    chSel.setRGBChannels(chTypeRed, chTypeBlue, chTypeGreen);
    rsb_1.setChannelSelection(chSel);
    rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
    rsb_1.setContrastEnhancement(cntEnh);
    rsb_1.setOverlap(sldBuilder.literalExpression("AVERAGE"));
   
    // visit the RasterSymbolizer
    rsh.visit(rsb_1);
   
    testRasterSymbolizerHelper(rsh);
View Full Code Here

                new double[] { 90, 180 }));
   
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);
    // build the RasterSymbolizer
    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeGray    = new SelectedChannelTypeImpl();
    final ContrastEnhancement cntEnh = new ContrastEnhancementImpl();

    cntEnh.setMethod(ContrastMethod.HISTOGRAM);;
    //cntEnh.setGammaValue(sldBuilder.literalExpression(0.50));
   
    chTypeGray.setChannelName("1");   
    chSel.setGrayChannel(chTypeGray);

    rsb_1.setChannelSelection(chSel);
    rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
    rsb_1.setContrastEnhancement(cntEnh);
    rsb_1.setOverlap(sldBuilder.literalExpression("AVERAGE"));

    final ColorMap cm = sldBuilder.createColorMap(
        new String[] { // labels
          "category",
          "category",
          "category"
        },
View Full Code Here

        new GeneralEnvelope(new double[] { -90, -180 },
            new double[] { 90, 180 }));
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);
    // build the RasterSymbolizer
    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeGray = new SelectedChannelTypeImpl();
    final ContrastEnhancement cntEnh = new ContrastEnhancementImpl();

    //this will convert to byte!!!
View Full Code Here

                                                new GridSampleDimension[] { new GridSampleDimension(
                                                                "sd", new Category[] { new Category("",
                                                                                Color.BLACK, 0) }, null) }, null, null);

                // build the RasterSymbolizer
                StyleBuilder sldBuilder = new StyleBuilder();
                rsh = new RasterSymbolizerHelper(gc, null);
                rs = sldBuilder.createRasterSymbolizer();
                final ColorMap cm = sldBuilder.createColorMap(
                                new String[] { // labels
                                        "category0",
                                        "category1",
                                        "category2"
                                },
View Full Code Here

    .create(
        "name",
        JAI.create("ImageRead", TestData.file(this,"smalldem.tif")),
        new GeneralEnvelope(new double[] { -90, -180 },
            new double[] { 90, 180 }));
    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeGray = new SelectedChannelTypeImpl();
    chTypeGray.setChannelName("1");
    chSel.setGrayChannel(chTypeGray);
    rsb_1.setChannelSelection(chSel);
    rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
    final ColorMap cm = sldBuilder.createColorMap(
        new String[] { // labels
          "category",
          "category",
          "category"
        },
View Full Code Here

TOP

Related Classes of org.geotools.styling.StyleBuilder$EqualClasses

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.