Package org.geotools.styling

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


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


        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);
    }
   
    public void testRenderPolygonEmptyRings() throws SchemaException, IllegalAttributeException {
View Full Code Here

                        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);
    }
   
    public void testMixedEmptyMultiLine() throws SchemaException, IllegalAttributeException {
View Full Code Here

        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

                "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

      CoordinateReferenceSystem mapCRS = CRS.decode("EPSG:3857", true);
      ReferencedEnvelope read3857 = read26915.transform(mapCRS, true);
     
      // setup map content
      StyleBuilder sb = new StyleBuilder();
        Layer layer = new GridReaderLayer(new GeoTiffReader(testFile), sb.createStyle(sb.createRasterSymbolizer()));
        MapContent mc = new MapContent();
        mc.getViewport().setBounds(read3857);
        mc.addLayer(layer);
       
        StreamingRenderer sr = new StreamingRenderer();
View Full Code Here

        PropertyDataStore ds = new PropertyDataStore(property.getParentFile());
        SimpleFeatureSource fs = ds.getFeatureSource("buildings");
        ReferencedEnvelope bounds = new ReferencedEnvelope(0, 10, 0, 10, DefaultGeographicCRS.WGS84);

        StyleBuilder sb = new StyleBuilder();
        Style pst = sb.createStyle(sb.createPolygonSymbolizer(null, sb.createFill(Color.GRAY, 0.5)));
       
        // a raster layer
        BufferedImage bi = new BufferedImage(300, 300, BufferedImage.TYPE_4BYTE_ABGR);
        Graphics g = bi.getGraphics();
        g.setColor(Color.RED);
View Full Code Here

        g.setColor(Color.RED);
        g.fillRect(0, 0, 300, 300);
        g.dispose();
        GridCoverage2D coverage = new GridCoverageFactory().create("test_red", bi, bounds);
       
        Style rst = sb.createStyle(sb.createRasterSymbolizer());
   
    MapContent mc = new MapContent();
    mc.addLayer(new FeatureLayer(fs, pst));
    mc.addLayer(new GridCoverageLayer(coverage, rst));
   
View Full Code Here

    Rule rules[] = new Rule[] { rule1, rule2 };
    FeatureTypeStyle featureTypeStyle = builder.createFeatureTypeStyle("Feature", rules);
   
    //
    // create a "user defined" style
    Style style = builder.createStyle();
    style.setName("style");
    style.getDescription().setTitle("User Style");
    style.getDescription().setAbstract("Definition of Style");
    style.featureTypeStyles().add(featureTypeStyle);
    // styleBuilderExample end
View Full Code Here

   
    Graphic splat = builder.createGraphic(null, builder.createMark("splat"), null);
    PointSymbolizer symbolizer = builder.createPointSymbolizer(splat);
   
    // builder will fill in all the other classes with defaults
    Style style = builder.createStyle(symbolizer);
    // splatExample end
}

private void sldExample() {
    // sldExample start
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.