Package org.vfny.geoserver.wms

Examples of org.vfny.geoserver.wms.WMSMapContext


        final FeatureTypeInfo[] layers = request.getLayers();
        final Style[] styles = (Style[])request.getStyles().toArray(new Style[]{});

        //JD:make instance variable in order to release resources later
        //final WMSMapContext map = new WMSMapContext();
        map = new WMSMapContext();
       
        //DJB: the WMS spec says that the request must not be 0 area
        //     if it is, throw a service exception!
        Envelope env = request.getBbox();
        if (env.isNull() || (env.getWidth() <=0)|| (env.getHeight() <=0)){
View Full Code Here


    ds.createSchema(type);
    ds.addFeatures(new Feature[]{f1,f2,f3});
   
    FeatureSource fs = ds.getFeatureSource("test");
   
    final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(new Envelope(-250,250,-250,250));
        map.setMapWidth(300);
        map.setMapHeight(300);
        map.setBgColor(Color.red);
        map.setTransparent(false);

//        FilterFactory f = FilterFactory.createFilterFactory();
//        GeometryFilter filter = f.createGeometryFilter(GeometryFilter.GEOMETRY_BBOX);
//       
//        filter.addLeftGeometry(f.createAttributeExpression(type,"geom"));
//        filter.addRightGeometry(f.createBBoxExpression(new Envelope(-100,100,-100,100)));
       
      
        Style basicStyle = getStyle("default.sld");
        map.addLayer(fs, basicStyle);
       
        SVGMapProducer producer = new SVGMapProducer();
        producer.produceMap(map);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        producer.writeTo(out);
View Full Code Here

        final Envelope env = basicPolygons.getBounds();

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

        final WMSMapContext map = new WMSMapContext();
        map.setAreaOfInterest(env);
        map.setMapWidth(300);
        map.setMapHeight(300);
        map.setBgColor(Color.red);
        map.setTransparent(false);

        Style basicStyle = getStyle("default.sld");
        map.addLayer(basicPolygons, basicStyle);

        this.rasterMapProducer.setOutputFormat(mapFormat);
        this.rasterMapProducer.produceMap(map);

        assertNotBlank("testSimpleGetMapQuery", this.rasterMapProducer);
View Full Code Here

        double shift = env.getWidth() / 6;

        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.addLayer(ds.getFeatureSource(FORESTS_TYPE),
            getDefaultStyle(FORESTS_TYPE));
        map.addLayer(ds.getFeatureSource(LAKES_TYPE),
            getDefaultStyle(LAKES_TYPE));
        map.addLayer(ds.getFeatureSource(STREAMS_TYPE),
            getDefaultStyle(STREAMS_TYPE));
        map.addLayer(ds.getFeatureSource(NAMED_PLACES_TYPE),
            getDefaultStyle(NAMED_PLACES_TYPE));
        map.addLayer(ds.getFeatureSource(ROAD_SEGMENTS_TYPE),
            getDefaultStyle(ROAD_SEGMENTS_TYPE));
        map.addLayer(ds.getFeatureSource(PONDS_TYPE),
            getDefaultStyle(PONDS_TYPE));
        map.addLayer(ds.getFeatureSource(BUILDINGS_TYPE),
            getDefaultStyle(BUILDINGS_TYPE));

        map.addLayer(ds.getFeatureSource(DIVIDED_ROUTES_TYPE),
            getDefaultStyle(DIVIDED_ROUTES_TYPE));
        map.addLayer(ds.getFeatureSource(BRIDGES_TYPE),
            getDefaultStyle(BRIDGES_TYPE));

        map.addLayer(ds.getFeatureSource(MAP_NEATLINE_TYPE),
            getDefaultStyle(MAP_NEATLINE_TYPE));

        map.setAreaOfInterest(env);

        this.rasterMapProducer.setOutputFormat("image/png");
        this.rasterMapProducer.produceMap(map);

        assertNotBlank("testBlueLake", this.rasterMapProducer);
View Full Code Here

        double shift = env.getWidth() / 6;

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

        WMSMapContext map = new WMSMapContext();
        map.addLayer(fSource, style);
        map.setAreaOfInterest(env);
        map.setMapWidth(w);
        map.setMapHeight(h);
        map.setBgColor(BG_COLOR);
        map.setTransparent(false);

        this.rasterMapProducer.setOutputFormat("image/png");
        this.rasterMapProducer.produceMap(map);

        BufferedImage image = 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.