Package org.geotools.renderer.lite

Examples of org.geotools.renderer.lite.StreamingRenderer$PainterThread


        MapContext context = new DefaultMapContext(crs);
        Style style = new BasicPolygonStyle();
        context.addLayer(featureSource, style);
        context.setAreaOfInterest(bounds);
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(context);

        BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_ARGB);
        Graphics2D graphics = image.createGraphics();
        Rectangle paintArea = new Rectangle(800, 600);
        ReferencedEnvelope mapArea = bounds;
        Stopwatch sw = new Stopwatch();
        long totalTime = 0;
        for (int i = 0; i < numRuns; i++) {
            sw.start();
            renderer.paint(graphics, paintArea, mapArea);
            sw.stop();
            totalTime += sw.getTime();
            log("Layer rendered in " + sw.getTimeString());
            sw.reset();
            File output = new File("testRender.png");
View Full Code Here


        GridCoverage2D coverage = createCoverage();
        Style style = createCoverageStyle("1");

        MapContext context = new MapContext();
        context.addLayer(coverage, style);
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(context);

        RenderListener listener = new RenderListener() {
            public void featureRenderer(SimpleFeature feature) {}

            public void errorOccurred(Exception e) {
                e.printStackTrace();
                fail("Failed to render coverage");
            }
        };

        renderer.addRenderListener(listener);

        BufferedImage image = new BufferedImage(WIDTH, WIDTH, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2D = image.createGraphics();

        /*
         * Turn off logging and try to render the coverage
         */
        Logger logger = Logger.getLogger(LOGGER_NAME);
        final Level savedLevel = logger.getLevel();
        logger.setLevel(Level.OFF);

        try {
            renderer.paint(g2D, bounds, env);
        } finally {
            logger.setLevel(savedLevel);
        }
    }
View Full Code Here

        PropertyDataStore ds = new PropertyDataStore(property.getParentFile());
        fs = ds.getFeatureSource("cities");
        bounds = fs.getBounds();
        bounds.expandBy(10);
       
        renderer = new StreamingRenderer();
       
        // System.setProperty("org.geotools.test.interactive", "true");
    }
View Full Code Here

        // Create a 3D renderer
        final Renderer3D renderer3D = new Renderer3DImpl( exampleMap );
        final Component mapView3D = renderer3D.get3DView();

        // Create a 2D renderer with the same data for comparsion
        final StreamingRenderer streamingRenderer = new StreamingRenderer();
        final JMapPane mapView2D = new JMapPane( streamingRenderer, exampleMap );
        mapView2D.setMapArea( exampleMap.getLayerBounds() );
        mapView2D.setState( JMapPane.Pan );
        mapView2D.setCursor( new Cursor( Cursor.MOVE_CURSOR ) );
View Full Code Here

    private GTRenderer createRenderer()
    {
        GTRenderer renderer;
        if ( false )
        {
            renderer = new StreamingRenderer();
            HashMap hints = new HashMap();
            hints.put( "memoryPreloadingEnabled", Boolean.TRUE );
            renderer.setRendererHints( hints );
        }
        else
        {
            renderer = new StreamingRenderer();
            HashMap hints = new HashMap();
            hints.put( "memoryPreloadingEnabled", Boolean.FALSE );
            renderer.setRendererHints( hints );
        }
        return renderer;
View Full Code Here

   
    SVGGraphics2D g2d = new SVGGraphics2D(ctx, true);
   
    g2d.setSVGCanvasSize(canvasSize);
   
    StreamingRenderer renderer = new StreamingRenderer();
    renderer.setMapContent(map);
   
    Rectangle outputArea = new Rectangle(g2d.getSVGCanvasSize());
    ReferencedEnvelope dataArea = map.getMaxBounds();
   
    LOGGER.finest("rendering map");
    renderer.paint(g2d, outputArea, dataArea);
    LOGGER.finest("writing to file");
    OutputStreamWriter osw = null;
    try {
        osw = new OutputStreamWriter(out, "UTF-8");
        g2d.stream(osw);
View Full Code Here

     *
     * @return the renderer
     */
    public GTRenderer getRenderer() {
        if (renderer == null) {
            doSetRenderer(new StreamingRenderer());
        }
        return renderer;
    }
View Full Code Here

     * @param showLayerTable
     * @param showStatusBar
     * @param content the map context with layers to be displayed
     */
    public SwtMapFrame( boolean showMenu, boolean showToolBar, boolean showStatusBar, boolean showLayerTable, MapContent content ) {
        this(showMenu, showToolBar, showStatusBar, showLayerTable, content, new StreamingRenderer());
    }
View Full Code Here

            // op.graphics.setBackground(getBackground());
            // op.graphics.clearRect(0, 0, r.width, r.height);
        }
       
        if (op.renderer == null) {
            op.renderer = new StreamingRenderer();
            op.renderer.setRendererHints(renderingHints);
        }
       
        return new RenderingOperands(layer, op.graphics, op.renderer);
    }
View Full Code Here

        Rectangle paintArea = new Rectangle(mapWidth, mapHeight);

        mapContext.setAreaOfInterest(areaOfInterest, crs);

        GTRenderer renderer = new StreamingRenderer();
        renderer.setContext(mapContext);
        RenderingHints hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        renderer.setJava2DHints(hints);

        Map renderingHints = new HashMap();
        renderingHints.put("optimizedDataLoadingEnabled", Boolean.TRUE);
        renderingHints.put(StreamingRenderer.ADVANCED_PROJECTION_HANDLING_KEY, Boolean.TRUE);
        renderingHints.put(StreamingRenderer.CONTINUOUS_MAP_WRAPPING, Boolean.TRUE);
        renderer.setRendererHints(renderingHints);
        renderer.paint(graphics, paintArea, areaOfInterest);
    }
View Full Code Here

TOP

Related Classes of org.geotools.renderer.lite.StreamingRenderer$PainterThread

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.