Examples of DefaultMapContext


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("testSimplePointRender", renderer, 1000,
        env);

  }
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    // //
    //
    // Create the map context
    //
    // //
    MapContext map = new DefaultMapContext();
    map.setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84);
    map.addLayer(ft, style);
    map.setAreaOfInterest(map.getLayerBounds());

    // //
    //
    // Create the streaming renderer
    //
    // //
    StreamingRenderer renderer = new StreamingRenderer();
    renderer.setContext(map);
    renderer.setRendererHints(rendererHints);

    // //
    //
    // Transform the area of interest
    //
    // //
    final CoordinateReferenceSystem crs =  CRS
    .parseWKT("PROJCS[\"NAD83 / BC"
        + "Albers\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"
        + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],"
        + "TOWGS84[0,0,0],AUTHORITY[\"EPSG\",\"6269\"]],"
        + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"
        + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"
        + "AUTHORITY[\"EPSG\",\"4269\"]],"
        + "PROJECTION[\"Albers_Conic_Equal_Area\"],"
        + "PARAMETER[\"standard_parallel_1\",50],"
        + "PARAMETER[\"standard_parallel_2\",58.5],"
        + "PARAMETER[\"latitude_of_center\",45],"
        + "PARAMETER[\"longitude_of_center\",-126],"
        + "PARAMETER[\"false_easting\",1000000],"
        + "PARAMETER[\"false_northing\",0],"
        + "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"
        + "AUTHORITY[\"EPSG\",\"3005\"]]");
    final MathTransform t = CRS.findMathTransform(DefaultGeographicCRS.WGS84, crs,
        true);

    // //
    //
    // Set the new AOI
    //
    // //
    final ReferencedEnvelope env = (ReferencedEnvelope) map
        .getLayerBounds();
    final ReferencedEnvelope bounds = new ReferencedEnvelope(JTS.transform(
        env, null, t, 10), crs);

    RendererBaseTest.showRender("testReprojection", renderer, 1000, bounds);
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    //
    // CREATE MAP CONTEXT AND RENDERER
    //
    //
    // /////////////////////////////////////////////////////////////////
    final MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
    map.addLayer(ft, style);

    // ///////////////////////////////////////////////////////////////////
    //
    // CREATE A PROJECTED AOI
    //
    //
    // /////////////////////////////////////////////////////////////////
    final CoordinateReferenceSystem crs =  CRS
    .parseWKT("PROJCS[\"NAD83 / BC"
        + "Albers\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"
        + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],"
        + "TOWGS84[0,0,0],AUTHORITY[\"EPSG\",\"6269\"]],"
        + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"
        + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"
        + "AUTHORITY[\"EPSG\",\"4269\"]],"
        + "PROJECTION[\"Albers_Conic_Equal_Area\"],"
        + "PARAMETER[\"standard_parallel_1\",50],"
        + "PARAMETER[\"standard_parallel_2\",58.5],"
        + "PARAMETER[\"latitude_of_center\",45],"
        + "PARAMETER[\"longitude_of_center\",-126],"
        + "PARAMETER[\"false_easting\",1000000],"
        + "PARAMETER[\"false_northing\",0],"
        + "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"
        + "AUTHORITY[\"EPSG\",\"3005\"]]");

    // /////////////////////////////////////////////////////////////////
    //
    // CREATE MAP CONTEXT AND RENDERER
    //
    //
    // /////////////////////////////////////////////////////////////////
    final StreamingRenderer renderer = new StreamingRenderer();
    renderer.setRendererHints(rendererHints);
    renderer.setContext(map);

    ReferencedEnvelope env = map.getLayerBounds();
    env = new ReferencedEnvelope(env.getMinX() - 20, env.getMaxX() + 20,
        env.getMinY() - 20, env.getMaxY() + 20,
        DefaultGeographicCRS.WGS84);
    final ReferencedEnvelope newbounds = env.transform(crs, true);
    RendererBaseTest.showRender("testLineReprojection", renderer, 1000,
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    //
    // CREATE MAP CONTEXT AND RENDERER
    //
    //
    // /////////////////////////////////////////////////////////////////
    final MapContext map = new DefaultMapContext(DefaultGeographicCRS.WGS84);
    map.addLayer(ft, style);

    // ///////////////////////////////////////////////////////////////////
    //
    // CREATE A PROJECTED AOI
    //
    //
    // /////////////////////////////////////////////////////////////////
    // //
    //
    // Transform the area of interest
    //
    // //
    final CoordinateReferenceSystem crs =  CRS
    .parseWKT("PROJCS[\"NAD83 / BC"
        + "Albers\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS"
        + "1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],"
        + "TOWGS84[0,0,0],AUTHORITY[\"EPSG\",\"6269\"]],"
        + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"
        + "UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],"
        + "AUTHORITY[\"EPSG\",\"4269\"]],"
        + "PROJECTION[\"Albers_Conic_Equal_Area\"],"
        + "PARAMETER[\"standard_parallel_1\",50],"
        + "PARAMETER[\"standard_parallel_2\",58.5],"
        + "PARAMETER[\"latitude_of_center\",45],"
        + "PARAMETER[\"longitude_of_center\",-126],"
        + "PARAMETER[\"false_easting\",1000000],"
        + "PARAMETER[\"false_northing\",0],"
        + "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"
        + "AUTHORITY[\"EPSG\",\"3005\"]]");

    // /////////////////////////////////////////////////////////////////
    //
    // CREATE MAP CONTEXT AND RENDERER
    //
    //
    // /////////////////////////////////////////////////////////////////
    final StreamingRenderer renderer = new StreamingRenderer();
    renderer.setRendererHints(rendererHints);
    renderer.setContext(map);

    ReferencedEnvelope env = map.getLayerBounds();
    env = new ReferencedEnvelope(env.getMinX() - 20, env.getMaxX() + 20,
        env.getMinY() - 20, env.getMaxY() + 20,
        DefaultGeographicCRS.WGS84);
    final ReferencedEnvelope newbounds = env.transform(crs, true);
    RendererBaseTest.showRender("testPointReprojection", renderer, 1000,
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

   
   

    private void renderEmptyGeometry(SimpleFeature f, Style style) {
        SimpleFeatureCollection fc = DataUtilities.collection(f);
        MapContext mc = new DefaultMapContext();
        mc.addLayer(fc, style);
        StreamingRenderer sr = new StreamingRenderer();
        sr.setContext(mc);
        BufferedImage bi = new BufferedImage(640, 480, BufferedImage.TYPE_4BYTE_ABGR);
        sr.addRenderListener(new RenderListener() {
       
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

        return sb.createStyle(sb.createLineSymbolizer());
    }

    public void testSkipProjectionErrors() throws Exception {
        // build map context
        MapContext mapContext = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mapContext.addLayer(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, -170, 20, 40),
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    }
   
    public void testLabelNatural() throws Exception {
        Style style = RendererBaseTest.loadStyle(this, "textNaturalOrientation.sld");
       
        DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mc.addLayer(fs, style);
       
        renderer.setContext(mc);
       
        RendererBaseTest.showRender("Lines with circle stroke", renderer, TIME, bounds);
    }
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    }
   
    public void testLabelLineOrientation() throws Exception {
        Style style = RendererBaseTest.loadStyle(this, "textLineOrientation.sld");
       
        DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mc.addLayer(fs, style);
       
        renderer.setContext(mc);
       
        RendererBaseTest.showRender("Lines with circl stroke", renderer, TIME, bounds);
    }
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    }
   
    public void testPieCharts() throws Exception {
        Style style = RendererBaseTest.loadStyle(this, "pieCharts.sld");
       
        DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mc.addLayer(fs, style);
       
        renderer.setContext(mc);
       
        RendererBaseTest.showRender("Pie charts", renderer, TIME, bounds, 600, 300);
    }
View Full Code Here

Examples of org.geotools.map.DefaultMapContext

    @Test
    public void testBufferLine() throws Exception {
        Style style = RendererBaseTest.loadStyle(this, "lineBuffer.sld");

        DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
        mc.addLayer(fs, style);

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setContext(mc);

        RendererBaseTest.showRender("lineBuffer.sld", 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.