Examples of DefaultMapContext


Examples of org.geotools.map.DefaultMapContext

        final Envelope world = new Envelope(0, 50, 0, -100);
        final AffineTransform worldToScreen = AffineTransform.getRotateInstance(Math.toRadians(90), 0, 0);
        DefaultFeatureCollection fc = new DefaultFeatureCollection();
        fc.add(createPoint(0, 0));
        fc.add(createPoint(world.getMaxX(), world.getMinY()));
        MapContext mapContext = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mapContext.addLayer((FeatureCollection)fc, createPointStyle());
        BufferedImage image = new BufferedImage(screen.width, screen.height,
                BufferedImage.TYPE_4BYTE_ABGR);
        final StreamingRenderer sr = new StreamingRenderer();
        sr.setContext(mapContext);
        sr.paint(image.createGraphics(), screen, worldToScreen);
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

 
        public void testPointLabeling() throws Exception {
            FeatureCollection collection = createPointFeatureCollection();
            Style style = loadStyle("PointStyle.sld");
            assertNotNull(style);
            MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
            map.addLayer(collection, style);

            StreamingRenderer renderer = new StreamingRenderer();
            renderer.setContext(map);
            ReferencedEnvelope env = map.getLayerBounds();
            int boundary = 10;
            env = new ReferencedEnvelope(env.getMinX() - boundary, env.getMaxX() + boundary,
                    env.getMinY() - boundary, env.getMaxY() + boundary, null);
            RendererBaseTest.showRender("testPointLabeling", renderer, timout, env);
        }
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

  
    public void testLineLabeling() throws Exception {
        FeatureCollection collection = createLineFeatureCollection();
        Style style = loadStyle("LineStyle.sld");
        assertNotNull(style);
        MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        map.addLayer(collection, style);

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(map);
        ReferencedEnvelope env = map.getLayerBounds();
        int boundary = 10;
        env = new ReferencedEnvelope(env.getMinX() - boundary, env.getMaxX() + boundary, env
                .getMinY()
                - boundary, env.getMaxY() + boundary, null);
       
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

     */
    public void testLineLabelingUom() throws Exception {
        FeatureCollection collection = createLineFeatureCollection();
        Style style = loadStyle("LineStyleUom.sld");
        assertNotNull(style);
        MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        map.addLayer(collection, style);

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(map);
        ReferencedEnvelope env = map.getLayerBounds();
        int boundary = 10000;
        env = new ReferencedEnvelope(env.getMinX() - boundary, env.getMaxX() + boundary, env
                .getMinY()
                - boundary, env.getMaxY() + boundary, null);
       
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

 
  public void testPolyLabeling() throws Exception{   
    FeatureCollection collection=createPolyFeatureCollection();
    Style style=loadStyle("PolyStyle.sld");
    assertNotNull(style);
    MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        map.addLayer(collection, style);
        StreamingRenderer renderer=new StreamingRenderer();
        renderer.setContext(map);
        ReferencedEnvelope env = map.getLayerBounds();
        int boundary=10;
        env = new ReferencedEnvelope(env.getMinX() - boundary, env.getMaxX() + boundary,
            env.getMinY() - boundary, env.getMaxY() + boundary, null);
        RendererBaseTest.showRender("testPolyLabeling", renderer, timout, env);
  }
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

   
    public void testExternalGraphic() throws Exception {
        Style pStyle = RendererBaseTest.loadStyle(this, "externalGraphic.sld");
        Style lStyle = RendererBaseTest.loadStyle(this, "lineGray.sld");
       
        DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mc.addLayer(lineFS, lStyle);
        mc.addLayer(pointFS, pStyle);
       
        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
       
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

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

        DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mc.addLayer(lineFS, lStyle);
        mc.addLayer(pointFS, pStyle);

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

Examples of org.geotools.map.DefaultMapContext

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

        DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mc.addLayer(lineFS, lStyle);
        mc.addLayer(pointFS, pStyle);

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(mc);
        renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
        Map rendererParams = new HashMap();
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    // ////////////////////////////////////////////////////////////////////
    //
    // CREATING MAP CONTEXT
    //
    // ////////////////////////////////////////////////////////////////////
    final MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
    map.addLayer(ft, style);
    map.setAreaOfInterest(map.getLayerBounds());

    // ////////////////////////////////////////////////////////////////////
    //
    // CREATING STREAMING RENDERER
    //
    // ////////////////////////////////////////////////////////////////////
    final StreamingRenderer renderer = new StreamingRenderer();
    renderer.setContext(map);
    renderer.setRendererHints(rendererHints);

    // ////////////////////////////////////////////////////////////////////
    //
    // SHOWING RENDERER
    //
    // ////////////////////////////////////////////////////////////////////
    RendererBaseTest.showRender("testSimplePolygonRender", renderer, 1000,
        map.getLayerBounds());

  }
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    // ////////////////////////////////////////////////////////////////////
    //
    // CREATING MAP CONTEXT
    //
    // ////////////////////////////////////////////////////////////////////
    final MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
    map.addLayer(ft, style);
    map.setAreaOfInterest(map.getLayerBounds());

    // ////////////////////////////////////////////////////////////////////
    //
    // CREATING STREAMING RENDERER
    //
    // ////////////////////////////////////////////////////////////////////
    final StreamingRenderer renderer = new StreamingRenderer();
    renderer.setContext(map);
    renderer.setRendererHints(rendererHints);

    // ////////////////////////////////////////////////////////////////////
    //
    // SHOWING RENDERER
    //
    // ////////////////////////////////////////////////////////////////////
    ReferencedEnvelope env = map.getLayerBounds();
    env = new ReferencedEnvelope(env.getMinX() - 20, env.getMaxX() + 20,
        env.getMinY() - 20, env.getMaxY() + 20, map
            .getCoordinateReferenceSystem());
    RendererBaseTest
        .showRender("testSimpleLineRender", renderer, 1000, env);

  }
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.