Examples of featureTypeStyles()


Examples of org.geotools.styling.Style.featureTypeStyles()

    @Test
    public void testV2ParseDefaultSymbolizers() throws Throwable {
        final Style style = parseStyle("v2-style-default-symbolizers.json");

        final List<FeatureTypeStyle> featureTypeStyles = style.featureTypeStyles();
        assertEquals(1, featureTypeStyles.size());
        final List<Rule> rules = featureTypeStyles.get(0).rules();
        assertEquals(1, rules.size());
        final Rule rule = rules.get(0);
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

            .andReturn();

        StyledLayerDescriptor sld = Ysld.parse(result.getResponse().getContentAsString());
        Style style = ((NamedLayer)sld.layers().get(0)).getStyles()[0];

        assertTrue(style.featureTypeStyles().get(0).rules().get(0).symbolizers().get(0) instanceof PointSymbolizer);
    }

    @Test
    public void testGetStyleRaw() throws Exception {
        MockGeoServer.get().catalog()
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

            FeatureTypeStyle featureTypeStyle = styleFactory.createFeatureTypeStyle();
            featureTypeStyle.rules().add(rule);

            Style style = styleFactory.createStyle();
            style.featureTypeStyles().add(featureTypeStyle);

            try {
                when(this.style.getStyle()).thenReturn(style);
            } catch (IOException e) {
                throw new RuntimeException(e);
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

    public void defaults() {
        Style style = new StyleBuilder().build();

        assertNotNull(style);
        assertNull(style.getName());
        assertEquals(1, style.featureTypeStyles().size());

        FeatureTypeStyle fts = style.featureTypeStyles().get(0);
        assertNotNull(fts);
        assertEquals(0, fts.featureTypeNames().size());
        assertEquals(1, fts.rules().size());
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

        assertNotNull(style);
        assertNull(style.getName());
        assertEquals(1, style.featureTypeStyles().size());

        FeatureTypeStyle fts = style.featureTypeStyles().get(0);
        assertNotNull(fts);
        assertEquals(0, fts.featureTypeNames().size());
        assertEquals(1, fts.rules().size());

        Rule r = fts.rules().get(0);
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

        FeatureTypeStyle fts = sf.createFeatureTypeStyle();
        fts.rules().add(rule);

        Style style = sf.createStyle();
        style.featureTypeStyles().add(fts);
        return style;
    }

    @Test
    public void testOffsetLabel() throws IOException {
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

        final int height = testImage.getHeight();
       
        // Get graphic legend from style
        final Style style = RendererBaseTest.loadStyle(
                this, "testGraphicLegend.sld");
        final Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        final GraphicLegend legend = (GraphicLegend) rule.getLegend();
       
        // Paint legend using StyledShapePainter
        final Point point = new GeometryFactory().createPoint(
                new Coordinate(width / 2, height / 2));
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

        final int height = testImage.getHeight();
       
        // Get graphic legend from style
        final Style style = RendererBaseTest.loadStyle(
                this, "testGraphicLegend.sld");
        final Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        final GraphicLegend legend = (GraphicLegend) rule.getLegend();
       
       
        // Set rotation to 45 degrees
        legend.setRotation( ff.literal(45.0) );
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

  }

  private static RasterSymbolizer extractRasterSymbolizer(StyledLayerDescriptor sld) {
    final UserLayer nl = (UserLayer) sld.getStyledLayers()[0];
    final Style style = nl.getUserStyles()[0];
    final FeatureTypeStyle fts = style.featureTypeStyles().get(0);
    final Rule rule = fts.rules().get(0);
    final RasterSymbolizer rs_1 = (RasterSymbolizer) rule.getSymbolizers()[0];
    return rs_1;
  }
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

    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));

        RendererBaseTest.showRender("Spatial with default CRS", renderer, TIME, bounds);
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.