Package org.vfny.geoserver.wms

Examples of org.vfny.geoserver.wms.WMSMapContext


        final FeatureSource<SimpleFeatureType,SimpleFeature> fs = testDS.getFeatureSource("RoadSegments");
        final ReferencedEnvelope env = new ReferencedEnvelope(fs.getBounds(),WGS84);

        LOGGER.info("about to create map ctx for RoadSegments with filter on name and bounds " + env);

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(env);
        map.setMapWidth(mapWidth);
        map.setMapHeight(mapHeight);
       
        map.setTransparent(false);
               
        Style basicStyle = getTestStyle("RoadSegmentsFiltered.sld");
        map.addLayer(fs, basicStyle);

        this.mapProducer.setOutputFormat("text/html");
        this.mapProducer.setMapContext(map);
        this.mapProducer.produceMap();
        assertTestResult("RoadSegmentsFiltered", this.mapProducer);
View Full Code Here


        final FeatureSource<SimpleFeatureType,SimpleFeature> fs = testDS.getFeatureSource("BuildingCenters");
        final ReferencedEnvelope env = new ReferencedEnvelope(fs.getBounds(),WGS84);

        LOGGER.info("about to create map ctx for BuildingCenters with bounds " + env);

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(env);
        map.setMapWidth(mapWidth);
        map.setMapHeight(mapHeight);
       
        map.setTransparent(false);
               
        Style basicStyle = getTestStyle("BuildingCenters.sld");
        map.addLayer(fs, basicStyle);

        this.mapProducer.setOutputFormat("text/html");
        this.mapProducer.setMapContext(map);
        this.mapProducer.produceMap();
        assertTestResult("BuildingCenters", this.mapProducer);
View Full Code Here

        final FeatureSource<SimpleFeatureType,SimpleFeature> fs = testDS.getFeatureSource("BuildingCentersMultiPoint");
        final ReferencedEnvelope env = new ReferencedEnvelope(fs.getBounds(),WGS84);

        LOGGER.info("about to create map ctx for BuildingCentersMultiPoint with bounds " + env);

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(env);
        map.setMapWidth(mapWidth);
        map.setMapHeight(mapHeight);
       
        map.setTransparent(false);
               
        Style basicStyle = getTestStyle("BuildingCenters.sld");
        map.addLayer(fs, basicStyle);

        this.mapProducer.setOutputFormat("text/html");
        this.mapProducer.setMapContext(map);
        this.mapProducer.produceMap();
        assertTestResult("BuildingCentersMultiPoint", this.mapProducer);
View Full Code Here

        final FeatureSource<SimpleFeatureType,SimpleFeature> fs = testDS.getFeatureSource("CollectionSample");
        final ReferencedEnvelope env = new ReferencedEnvelope(fs.getBounds(),WGS84);

        LOGGER.info("about to create map ctx for RoadSegments with bounds " + env);

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(env);
        map.setMapWidth(mapWidth);
        map.setMapHeight(mapHeight);
       
        map.setTransparent(false);
               
        Style basicStyle = getTestStyle("CollectionSample.sld");
        map.addLayer(fs, basicStyle);

        this.mapProducer.setOutputFormat("text/html");
        this.mapProducer.setMapContext(map);
        this.mapProducer.produceMap();
        assertTestResult("CollectionSample", this.mapProducer);
View Full Code Here

    final FeatureSource<SimpleFeatureType,SimpleFeature> fs = testDS.getFeatureSource("NoCoords");
        final ReferencedEnvelope env = new ReferencedEnvelope(2.0,6.0,2.0,6.0,WGS84);
    
        LOGGER.info("about to create map ctx for NamedPlaces with bounds " + env);

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(env);
        map.setMapWidth(mapWidth);
        map.setMapHeight(mapHeight);
       
        map.setTransparent(false);
               
        Style basicStyle = getTestStyle("NamedPlaces.sld");
        map.addLayer(fs, basicStyle);

        this.mapProducer.setOutputFormat("text/html");
        this.mapProducer.setMapContext(map);
        this.mapProducer.produceMap();
        assertTestResult("NoCoords", this.mapProducer);
View Full Code Here

           
            nsSupport.declarePrefix("georss","http://www.georss.org/georss");
        }

        public void encode(Object o) throws IllegalArgumentException {
            WMSMapContext map = (WMSMapContext) o;

            start("feed");

            //title
            element("title", AtomUtils.getFeedTitle(map));
View Full Code Here

       
        final Envelope env = fs.getBounds();

        LOGGER.info("about to create map ctx for BasicPolygons with bounds " + env);

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(new ReferencedEnvelope(env, DefaultGeographicCRS.WGS84));
        map.setMapWidth(300);
        map.setMapHeight(300);
        map.setBgColor(Color.red);
        map.setTransparent(false);
        map.setRequest(new GetMapRequest(getWMS()));

        StyleInfo styleByName = catalog.getStyleByName("Default");
        Style basicStyle = styleByName.getStyle();
        map.addLayer(fs, basicStyle);

        this.rasterMapProducer.setOutputFormat(getMapFormat());
        this.rasterMapProducer.setMapContext(map);
        this.rasterMapProducer.produceMap();
View Full Code Here

        env = new Envelope(env.getMinX() - shift, env.getMaxX() + shift, env.getMinY() - shift, env
                .getMaxY()
                + shift);

        final WMSMapContext map = new WMSMapContext();
        int w = 400;
        int h = (int) Math.round((env.getHeight() * w) / env.getWidth());
        map.setMapWidth(w);
        map.setMapHeight(h);
        map.setBgColor(BG_COLOR);
        map.setTransparent(true);
        map.setRequest(new GetMapRequest(getWMS()));

        addToMap(map, MockData.FORESTS);
        addToMap(map, MockData.LAKES);
        addToMap(map, MockData.STREAMS);
        addToMap(map, MockData.NAMED_PLACES);
        addToMap(map, MockData.ROAD_SEGMENTS);
        addToMap(map, MockData.PONDS);
        addToMap(map, MockData.BUILDINGS);
        addToMap(map, MockData.DIVIDED_ROUTES);
        addToMap(map, MockData.BRIDGES);
        addToMap(map, MockData.MAP_NEATLINE);

        map.setAreaOfInterest(new ReferencedEnvelope(env, DefaultGeographicCRS.WGS84));

        this.rasterMapProducer.setOutputFormat(getMapFormat());
        this.rasterMapProducer.setMapContext(map);
        this.rasterMapProducer.produceMap();

View Full Code Here

        env = new Envelope(env.getMinX() - shift, env.getMaxX() + shift, env.getMinY() - shift, env
                .getMaxY()
                + shift);

        WMSMapContext map = new WMSMapContext();
        map.setRequest(new GetMapRequest(getWMS()));
        map.addLayer(fSource, style);
        map.setAreaOfInterest(new ReferencedEnvelope(env, DefaultGeographicCRS.WGS84));
        map.setMapWidth(w);
        map.setMapHeight(h);
        map.setBgColor(BG_COLOR);
        map.setTransparent(false);

        this.rasterMapProducer.setOutputFormat(getMapFormat());
        this.rasterMapProducer.setMapContext(map);
        this.rasterMapProducer.produceMap();
View Full Code Here

     * </p>
     */
    @SuppressWarnings("unchecked")
    private RenderedImage forceRenderingError(final Exception renderExceptionToThrow) throws Exception {

        final WMSMapContext map = new WMSMapContext();
        map.setMapWidth(100);
        map.setMapHeight(100);
        map.setRequest(new GetMapRequest(getWMS()));
        final ReferencedEnvelope bounds = new ReferencedEnvelope(-180, 180, -90, 90, DefaultGeographicCRS.WGS84);
        map.setAreaOfInterest(bounds);

        final FeatureTypeInfo ftInfo = getCatalog().getFeatureTypeByName(STREAMS.getNamespaceURI(), STREAMS.getLocalPart());

        final FeatureSource<SimpleFeatureType, SimpleFeature> featureSource = (FeatureSource<SimpleFeatureType, SimpleFeature>) ftInfo.getFeatureSource(null, null);
       
        DecoratingFeatureSource<SimpleFeatureType, SimpleFeature> source;
        // This source should make the renderer fail when asking for the features
        source = new DecoratingFeatureSource<SimpleFeatureType, SimpleFeature>(featureSource) {
            @Override
            public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatures(Query query)
                    throws IOException {
                throw new RuntimeException(renderExceptionToThrow);
                // return delegate.getFeatures(query);
            }
        };
       
        StyleInfo someStyle = getCatalog().getStyles().get(0);
        map.addLayer(source, someStyle.getStyle());
        this.rasterMapProducer.setOutputFormat(getMapFormat());
        this.rasterMapProducer.setMapContext(map);
        this.rasterMapProducer.produceMap();

        return this.rasterMapProducer.getImage();
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wms.WMSMapContext

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.