Package org.geotools.styling

Examples of org.geotools.styling.StyleBuilder$EqualClasses


        renderEmptyGeometry(f, style);
    }
   
    public void testRenderCollectionWithEmptyItems() throws SchemaException, IllegalAttributeException {
        GeometryFactory gf = new GeometryFactory();
        StyleBuilder sb = new StyleBuilder();
        SimpleFeatureType pointType = DataUtilities.createType("emptyPolygon", "geom:MultiPolygon,name:String");
        Polygon p1 = gf.createPolygon(gf.createLinearRing((Coordinate[]) null), null);
        Polygon p2 = gf.createPolygon(gf.createLinearRing(new Coordinate[] {new Coordinate(0,0),
                new Coordinate(1, 1), new Coordinate(1, 0), new Coordinate(0,0)}), null);
        MultiPolygon mp = gf.createMultiPolygon(new Polygon[] {p1, p2});
        SimpleFeature f = SimpleFeatureBuilder.build(pointType, new Object[] {mp, "name" }, null);
        Style style = sb.createStyle(sb.createPolygonSymbolizer());
       
        renderEmptyGeometry(f, style);
    }
View Full Code Here


        renderEmptyGeometry(f, style);
    }
   
    public void testRenderPolygonEmptyRings() throws SchemaException, IllegalAttributeException {
        GeometryFactory gf = new GeometryFactory();
        StyleBuilder sb = new StyleBuilder();
        SimpleFeatureType pointType = DataUtilities.createType("emptyRings", "geom:MultiPolygon,name:String");
        LinearRing emptyRing = gf.createLinearRing((Coordinate[]) null);
        LinearRing realRing = gf.createLinearRing(new Coordinate[] {new Coordinate(0,0),
                        new Coordinate(1, 1), new Coordinate(1, 0), new Coordinate(0,0)});
        Polygon p1 = gf.createPolygon(realRing, new LinearRing[] {emptyRing});
        Polygon p2 = gf.createPolygon(emptyRing, new LinearRing[] {emptyRing});
        MultiPolygon mp = gf.createMultiPolygon(new Polygon[] {p1, p2});
        SimpleFeature f = SimpleFeatureBuilder.build(pointType, new Object[] {mp, "name" }, null);
        Style style = sb.createStyle(sb.createPolygonSymbolizer());
       
        renderEmptyGeometry(f, style);
    }
View Full Code Here

        renderEmptyGeometry(f, style);
    }
   
    public void testMixedEmptyMultiLine() throws SchemaException, IllegalAttributeException {
        GeometryFactory gf = new GeometryFactory();
        StyleBuilder sb = new StyleBuilder();
        SimpleFeatureType pointType = DataUtilities.createType("emptyRings", "geom:MultiLineString,name:String");
        LineString emptyLine = gf.createLineString((Coordinate[]) null);
        LineString realLine = gf.createLineString(new Coordinate[] {new Coordinate(0,0),
                        new Coordinate(1, 1)});
        MultiLineString mls = gf.createMultiLineString(new LineString[] {emptyLine, realLine});
        SimpleFeature f = SimpleFeatureBuilder.build(pointType, new Object[] {mls, "name" }, null);
        Style style = sb.createStyle(sb.createPolygonSymbolizer());
       
        renderEmptyGeometry(f, style);
    }
View Full Code Here

        Rectangle screenSize = new Rectangle(256, 256);
        AffineTransform w2s = RendererUtilities.worldToScreenTransform(mapExtent, screenSize);
        GridCoverageRenderer renderer = new GridCoverageRenderer(DefaultGeographicCRS.WGS84,
                mapExtent, screenSize, w2s);

        RasterSymbolizer rasterSymbolizer = new StyleBuilder().createRasterSymbolizer();

        RenderedImage image = renderer.renderImage(worldReader, null, rasterSymbolizer,
                Interpolation.getInstance(Interpolation.INTERP_NEAREST), Color.RED, 256, 256);
        assertNull(image);
    }
View Full Code Here

                / mapExtent.getWidth() * 500));
        AffineTransform w2s = RendererUtilities.worldToScreenTransform(mapExtent, screenSize);
        GridCoverageRenderer renderer = new GridCoverageRenderer(DefaultGeographicCRS.WGS84,
                mapExtent, screenSize, w2s);

        RasterSymbolizer rasterSymbolizer = new StyleBuilder().createRasterSymbolizer();

        RenderedImage image = renderer.renderImage(worldReader, null, rasterSymbolizer, Interpolation.getInstance(Interpolation.INTERP_BICUBIC),
                Color.RED, 256, 256);
        File reference = new File(
                "src/test/resources/org/geotools/renderer/lite/gridcoverage2d/wrapDatelineBicubic.png");
View Full Code Here

        AffineTransform w2s = RendererUtilities.worldToScreenTransform(mapExtent, screenSize);
        GridCoverageRenderer renderer = new GridCoverageRenderer(
                mapExtent.getCoordinateReferenceSystem(),
                mapExtent, screenSize, w2s);

        RasterSymbolizer rasterSymbolizer = new StyleBuilder().createRasterSymbolizer();

        RenderedImage image = renderer.renderImage(worldReader, null, rasterSymbolizer, Interpolation.getInstance(Interpolation.INTERP_BICUBIC),
                Color.RED, 256, 256);
        assertNotNull(image);
        File reference = new File(
View Full Code Here

                / mapExtent.getWidth() * 400));
        AffineTransform w2s = RendererUtilities.worldToScreenTransform(mapExtent, screenSize);
        GridCoverageRenderer renderer = new GridCoverageRenderer(
                mapExtent.getCoordinateReferenceSystem(), mapExtent, screenSize, w2s);

        RasterSymbolizer rasterSymbolizer = new StyleBuilder().createRasterSymbolizer();

        RenderedImage image = renderer.renderImage(worldReader, null, rasterSymbolizer, Interpolation.getInstance(Interpolation.INTERP_NEAREST),
                Color.RED, 256, 256);
        assertNotNull(image);
        File reference = new File(
View Full Code Here

                "src/test/resources/org/geotools/renderer/lite/gridcoverage2d/polar_whitecorner.png");
        ImageAssert.assertEquals(reference, image, 0);
    }

    private RasterSymbolizer buildRainColorMap() {
        StyleBuilder sb = new StyleBuilder();
        ColorMap colorMap = sb
                .createColorMap(new String[] { "1", "2", "3", "4" }, new double[] { 0, 100, 2000,
                        5000 }, new Color[] { Color.RED, Color.WHITE, Color.GREEN, Color.BLUE },
                        ColorMap.TYPE_RAMP);
        RasterSymbolizer rasterSymbolizer = sb.createRasterSymbolizer(colorMap, 1d);
        return rasterSymbolizer;
    }
View Full Code Here

        MapContent content = new MapContent();
        content.getViewport().setBounds(
                new ReferencedEnvelope(-179.9997834892, 180.00025801626, -89.999828389438,
                        270.00021311603, DefaultGeographicCRS.WGS84));
        RasterSymbolizer rs = buildRainColorMap();
        final Style style = new StyleBuilder().createStyle(rs);
        content.addLayer(new GridReaderLayer(rainReader, style));

        final StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(content);
        Map<Object, Object> rendererParams = new HashMap<Object, Object>();
View Full Code Here

        ImageAssert.assertEquals(new File(
                "src/test/resources/org/geotools/renderer/lite/inverted.png"), image, 1000);
    }

  private static Style getStyle() {
    StyleBuilder sb = new StyleBuilder();
    Style rasterstyle = sb.createStyle();
    RasterSymbolizer raster = sb.createRasterSymbolizer();
    rasterstyle.featureTypeStyles().add(sb.createFeatureTypeStyle(raster));
    rasterstyle.featureTypeStyles().get(0).setName("GridCoverage");
    return rasterstyle;
  }
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.