Package org.geotools.map

Examples of org.geotools.map.FeatureLayer


    @Test
    public void testFillSingle() throws Exception {
        Style style = RendererBaseTest.loadSEStyle(this, "margin/fill-single.sld");
       
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(bfs, style));
       
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
       
        BufferedImage image = RendererBaseTest.showRender("MarginFill", renderer, TIME, bounds);
View Full Code Here


        content.getViewport().setBounds(reference);
        assertEquals( "map viewport set", reference, content.getViewport().getBounds() );
        assertTrue( "map viewport WGS84",
                CRS.equalsIgnoreMetadata(DefaultGeographicCRS.WGS84,content.getCoordinateReferenceSystem()) );
       
        content.addLayer( new FeatureLayer( featuerSource, style ));
       
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(content);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
       
View Full Code Here

    private BufferedImage renderLabels(SimpleFeatureSource fs, Style style, String title)
            throws Exception {
        MapContent mc = new MapContent();
        mc.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);
        mc.addLayer(new FeatureLayer(fs, style));
       
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
        renderer.setMapContent(mc);
       
View Full Code Here

    private void runSingleLayerTest(String styleName, int threshold) throws Exception {
        Style style = RendererBaseTest.loadStyle(this, styleName);

        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
       
View Full Code Here

    public void testFTSComposition() throws Exception {
        Style bgStyle = RendererBaseTest.loadStyle(this, "fillSolid.sld");
        Style fgStyle = RendererBaseTest.loadStyle(this, "fillSolidFTS.sld");

        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(bfs, bgStyle));
        mc.addLayer(new FeatureLayer(fs, fgStyle));

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
        renderer.setMapContent(mc);
View Full Code Here

        Symbolizer sym = sf.createPolygonSymbolizer(Stroke.NULL,
                sf.createFill(ff2.literal(Color.CYAN)), null);
        Style style = SLD.wrapSymbolizers(sym);

        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
View Full Code Here

        MapContent mapContent = new MapContent();
        MapViewport viewport = mapContent.getViewport();
        viewport.setBounds(new ReferencedEnvelope(mapArea, DefaultGeographicCRS.WGS84));
        viewport.setScreenArea(new Rectangle(width, height));
        mapContent.addLayer(new FeatureLayer(featureSource, style));

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setRendererHints(renderingHints);
        renderer.setMapContent(mapContent);
        renderer.paint(g, viewport.getScreenArea(), viewport.getBounds());
View Full Code Here

    private void runFillTest(String styleName) throws Exception {
        Style style = RendererBaseTest.loadStyle(this, styleName);

        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(squareFS, style));

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
View Full Code Here

    public void testPoint() throws Exception {
        Style pStyle = RendererBaseTest.loadStyle(this, "pointHouse.sld");
        Style lStyle = RendererBaseTest.loadStyle(this, "lineGray.sld");

        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(lineFS, lStyle));
        mc.addLayer(new FeatureLayer(pointFS, pStyle));

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        renderer.setRendererHints(Collections.singletonMap(StreamingRenderer.VECTOR_RENDERING_KEY,
                true));
View Full Code Here

    @Test
    public void testEventAfterDrawing() throws Exception {
        // build map context
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(createLineCollection(), createLineStyle()));

        // build projected envelope to work with (small one around the area of
        // validity of utm zone 1, which being a Gauss projection is a vertical
        // slice parallel to the central meridian, -177°)
        ReferencedEnvelope reWgs = new ReferencedEnvelope(new Envelope(-180,
View Full Code Here

TOP

Related Classes of org.geotools.map.FeatureLayer

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.