Examples of FeatureLayer


Examples of org.geotools.map.FeatureLayer

    @Test
    public void testReprojectedPolygonFromSLD() throws Exception {
        // same as above, but with the style in SLD form
        Style style = RendererBaseTest.loadStyle(this, "spatialFilter.sld");
       
        content.addLayer(new FeatureLayer(pointFS, style));

        RendererBaseTest.showRender("Reprojected polygon from SLD", renderer, TIME, bounds);
        assertEquals(1, renderedIds.size());
        assertEquals("point.4", renderedIds.iterator().next());
    }
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        StyleBuilder sb = new StyleBuilder();
        Symbolizer ps = sb.createPointSymbolizer();
        Style style = sb.createStyle(ps);
       
        // build a filter for the layer own definition query
        FeatureLayer layer = new FeatureLayer(pointFS, style);
        Polygon polygon = JTS.toGeometry((Envelope) envUTM31N);
        polygon.setUserData(utm31n);
        layer.setQuery(new DefaultQuery(null, ff.intersects(ff.property("geom"), ff.literal(polygon))));
       
        content.addLayer(layer);

        RendererBaseTest.showRender("Reprojected polygon as a definition query", renderer, TIME, bounds);
        assertEquals(1, renderedIds.size());
View Full Code Here

Examples of org.geotools.map.FeatureLayer

    @Test
    public void testWrapPointSymbolizer() throws Exception {
        Style style = RendererBaseTest.loadStyle(this, "pointPoly.sld");
       
        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));
        ReferencedEnvelope bounds = new ReferencedEnvelope(0, 370, 0, 10, DefaultGeographicCRS.WGS84);
        mc.getViewport().setBounds(bounds);
       
        StreamingRenderer renderer = new StreamingRenderer();
        Map<Object, Object> rendererParams = new HashMap<Object, Object>();
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        bounds.expandBy(1, 1);

        Style style = RendererBaseTest.loadStyle(this, "fillSolid.sld");

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

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        RenderingHints hints = new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
        hints.add(new RenderingHints(KEY_STROKE_CONTROL, VALUE_STROKE_PURE));
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        bounds.expandBy(1, 1);

        Style style = RendererBaseTest.loadStyle(this, "lineGray.sld");

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

        StreamingRenderer renderer = new StreamingRenderer();
        renderer.setMapContent(mc);
        RenderingHints hints = new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
        hints.add(new RenderingHints(KEY_STROKE_CONTROL, VALUE_STROKE_PURE));
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        params.put("url", url);
        DataStore dataStore = DataStoreFinder.getDataStore(params);
        String typeName = dataStore.getTypeNames()[0];
        SimpleFeatureSource featureSource = dataStore.getFeatureSource(typeName);

        return new FeatureLayer(featureSource, SLD.createSimpleStyle(featureSource.getSchema()));
    }
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        // Create a map content and add our shapefile to it
        MapContent map = new MapContent();
        map.setTitle("Using cached features");
        Style style = SLD.createSimpleStyle(featureSource.getSchema());
        Layer layer = new FeatureLayer(cache, style);
        map.addLayer(layer);

        // Now display the map
        JMapFrame.showMap(map);
    }
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        // Create a map content and add our shapefile to it
        MapContent map = new MapContent();
        map.setTitle("Quickstart");
       
        Style style = SLD.createSimpleStyle(featureSource.getSchema());
        Layer layer = new FeatureLayer(featureSource, style);
        map.addLayer(layer);

        // Now display the map
        JMapFrame.showMap(map);
    }
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        map.setTitle("ImageLab");
       
        Layer rasterLayer = new GridReaderLayer(reader, rasterStyle);
        map.addLayer(rasterLayer);
       
        Layer shpLayer = new FeatureLayer(shapefileSource, shpStyle);
        map.addLayer(shpLayer);

        // Create a JMapFrame with a menu to choose the display style for the
        frame = new JMapFrame(map);
        frame.setSize(800, 600);
View Full Code Here

Examples of org.geotools.map.FeatureLayer

        featureSource = store.getFeatureSource();

        // Create a map context and add our shapefile to it
        map = new MapContent();
        Style style = SLD.createSimpleStyle(featureSource.getSchema());
        Layer layer = new FeatureLayer(featureSource, style);
        map.layers().add(layer);

        // Create a JMapFrame with custom toolbar buttons
        JMapFrame mapFrame = new JMapFrame(map);
        mapFrame.enableToolBar(true);
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.